diff --git a/README.md b/README.md index c90a389..42ec433 100644 --- a/README.md +++ b/README.md @@ -11,4 +11,15 @@ then ./ttt ``` +## CPU +There is infact a CPU programmed into this application! +You can play against it if you swap out: +```c +41 player_choice('O'); +``` +with +```c +41 cpu_choice('O'); +``` + Enjoy! diff --git a/main.c b/main.c index 5e4fa99..62edd49 100644 --- a/main.c +++ b/main.c @@ -1,7 +1,7 @@ #include #include -#include #include +#include #define ROWS 3 #define COLUMNS 3 @@ -14,7 +14,6 @@ #define RESET "\033[0m" char board[ROWS][COLUMNS]; -char ESC = 27; void print_board(); void clear_board(); @@ -105,6 +104,7 @@ void player_choice(char player){ if(board[pr][pc] != ' ' ){ printf(BOLDRED "\n[%c] Cannot play here, skipping...\n" RESET, player); + sleep(2); } else { board[pr][pc] = player; } diff --git a/ttt b/ttt index 83d584f..7e66a8c 100755 Binary files a/ttt and b/ttt differ