diff options
| author | krolyxon <krolyxon@tutanota.com> | 2023-09-01 11:22:33 +0530 |
|---|---|---|
| committer | krolyxon <krolyxon@tutanota.com> | 2023-09-01 11:22:33 +0530 |
| commit | f8fc421e0b0d988e3c85c3a7e4b33a532f3c2827 (patch) | |
| tree | 7fd46e648e9d0554c2432df64de5b2335d115638 /src/utils.c | |
| parent | c6e829d33744f9896c913c35316199165f847f8e (diff) | |
beautification
Diffstat (limited to 'src/utils.c')
| -rw-r--r-- | src/utils.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/utils.c b/src/utils.c index 390aa7c..37b50bf 100644 --- a/src/utils.c +++ b/src/utils.c @@ -1,9 +1,10 @@ #include "utils.h" #include <stdio.h> +#include <stdlib.h> void printarr(int a[], int n) { for (int i = 0; i < n; i++) { - printf("%d ", a[i]); + printf(COLOR_BOLD "%d " COLOR_OFF, a[i]); } } @@ -24,3 +25,16 @@ void swap(int a[], int i, int j) { a[i] = a[j]; a[j] = tmp; } + + +void clearscreen(void) { +#ifdef _WIN32 + system("cls"); +#elif defined(unix) || defined(__unix__) || defined(__unix) || \ + (defined(__APPLE__) && defined(__MACH__)) + system("clear"); +#else +#error "OS not supported." +#endif +} + |
