aboutsummaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c16
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
+}
+