improved ui (added dark mode)

This commit is contained in:
bePrivate
2023-10-29 01:08:27 +02:00
parent dac2dee4a9
commit 5ab2552910
2 changed files with 13 additions and 12 deletions
BIN
View File
Binary file not shown.
+13 -12
View File
@@ -8,10 +8,11 @@
#include <unistd.h> #include <unistd.h>
#include <time.h> #include <time.h>
#define RESET "\x1b[0m" // color 0 #define RESET "\x1b[37;0m" // color 0
#define RED "\x1b[31m" // color 1 #define RED "\x1b[37;41m" // color 1
#define GREEN "\x1b[32m" // color 2 #define GREEN "\x1b[37;42m" // color 2
#define YELLOW "\x1b[33m" // color 3 #define YELLOW "\x1b[37;43m" // color 3
#define GRAY "\x1b[37;90m" // color gray
char wordlist_path[1024]; char wordlist_path[1024];
char wordlist[16384][6]; // 2^14 char wordlist[16384][6]; // 2^14
@@ -126,28 +127,28 @@ void clear() {
*/ */
void show() { void show() {
clear(); clear();
printf("╔═══╦═══╦═══╦═══╦═══╗\n"); printf(GRAY "╔═══╦═══╦═══╦═══╦═══╗" RESET "\n");
for (int i = 0; i < 6; i++) { for (int i = 0; i < 6; i++) {
for (int j = 0; j < 5; j++) { for (int j = 0; j < 5; j++) {
switch (pf_props[i][j][1]) { switch (pf_props[i][j][1]) {
case '0': case '0':
printf("║ %c ", playfield[i][j]); printf(GRAY "" RESET " %c ", playfield[i][j]);
break; break;
case '1': case '1':
printf(" " RED "%c " RESET, playfield[i][j]); printf(GRAY "" RED " %c " RESET, playfield[i][j]);
break; break;
case '2': case '2':
printf(" " GREEN "%c " RESET, playfield[i][j]); printf(GRAY "" GREEN " %c " RESET, playfield[i][j]);
break; break;
case '3': case '3':
printf(" " YELLOW "%c " RESET, playfield[i][j]); printf(GRAY "" YELLOW " %c " RESET, playfield[i][j]);
break; break;
} }
} }
printf("\n"); printf(GRAY "" RESET "\n");
if (i < 5) printf("╠═══╬═══╬═══╬═══╬═══╣\n"); if (i < 5) printf(GRAY "╠═══╬═══╬═══╬═══╬═══╣" RESET "\n");
} }
printf("╚═══╩═══╩═══╩═══╩═══╝\n"); printf(GRAY "╚═══╩═══╩═══╩═══╩═══╝" RESET "\n");
} }
/* /*