Commit 74ff9208 authored by Chris's avatar Chris
Browse files

never mind, clear_screen() was more platform specific with the macros

parent 53505052
Loading
Loading
Loading
Loading
+5 −13
Original line number Diff line number Diff line
@@ -19,17 +19,9 @@ void sleep_ms(const unsigned int ms) {
}

void clear_screen(void) {
    // keeping this for now pending Windows testing
    // #ifdef _WIN32
    //     system("cls");
    // #else
    //     system("clear");
    // #endif

    // the below approach is cross-platform!
    // breakdown:
    //      - \e is the escape character, beginning the escape sequence
    //      - [1:1H moves cursor to row 1, column 1
    //      - [2J is an escape character that clears the entire screen
    printf("\e[1;1H\e[2J");
    #ifdef _WIN32
        system("cls");
    #else
        system("clear");
    #endif
}