From 4cbbfb47b347652f8dc86d358b89790c62d119d2 Mon Sep 17 00:00:00 2001 From: fl3ka Date: Sun, 12 May 2024 14:49:34 +0200 Subject: [PATCH] Draw fix --- iksoks.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/iksoks.cpp b/iksoks.cpp index 5fe5bd0..4138f2a 100644 --- a/iksoks.cpp +++ b/iksoks.cpp @@ -27,11 +27,14 @@ void checkWin(char board[3][3], char player) { cout << board[0][0] << " WON!" << endl;} if(board[2][0] == player && board[1][1] == player && board[0][2] == player){ cout << board[2][0] << " WON!" << endl;} + + } int main(){ +int i; int row; int col; char player = 'X'; @@ -43,7 +46,7 @@ char board[3][3] = { { ' ', ' ', ' ' }, cout << "Welcome to Tic-Tac-Toe!\n"; -for(int i=0; i<8; i++){ +for(i=0; i<9; i++){ drawBoard(board); @@ -75,9 +78,11 @@ for(int i=0; i<8; i++){ continue; } } - -cout << "It's Draw!" << endl; - + +if(i = 9){ + cout << "It's Draw\n"; + drawBoard(board); +} return 0; }