Loading utils.c +5 −13 Original line number Diff line number Diff line Loading @@ -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 } Loading
utils.c +5 −13 Original line number Diff line number Diff line Loading @@ -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 }