|
|
@ -1,7 +1,7 @@ |
|
|
|
#include <stdio.h> |
|
|
|
#include <stdio.h> |
|
|
|
#include <stdlib.h> |
|
|
|
#include <stdlib.h> |
|
|
|
#include <stdbool.h> |
|
|
|
|
|
|
|
#include <time.h> |
|
|
|
#include <time.h> |
|
|
|
|
|
|
|
#include <unistd.h> |
|
|
|
|
|
|
|
|
|
|
|
#define ROWS 3 |
|
|
|
#define ROWS 3 |
|
|
|
#define COLUMNS 3 |
|
|
|
#define COLUMNS 3 |
|
|
@ -14,7 +14,6 @@ |
|
|
|
#define RESET "\033[0m" |
|
|
|
#define RESET "\033[0m" |
|
|
|
|
|
|
|
|
|
|
|
char board[ROWS][COLUMNS]; |
|
|
|
char board[ROWS][COLUMNS]; |
|
|
|
char ESC = 27; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void print_board(); |
|
|
|
void print_board(); |
|
|
|
void clear_board(); |
|
|
|
void clear_board(); |
|
|
@ -105,6 +104,7 @@ void player_choice(char player){ |
|
|
|
|
|
|
|
|
|
|
|
if(board[pr][pc] != ' ' ){ |
|
|
|
if(board[pr][pc] != ' ' ){ |
|
|
|
printf(BOLDRED "\n[%c] Cannot play here, skipping...\n" RESET, player); |
|
|
|
printf(BOLDRED "\n[%c] Cannot play here, skipping...\n" RESET, player); |
|
|
|
|
|
|
|
sleep(2); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
board[pr][pc] = player; |
|
|
|
board[pr][pc] = player; |
|
|
|
} |
|
|
|
} |
|
|
|