Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Tic_Tac_Toe_game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ void takeTurn() {

void switchPlayer() {
if (player == 'X') {
player = 'X';
player = 'O'; //correctedn switchPlayer()
} else {
player = 'O';
player = 'X';
}
}

Expand All @@ -46,10 +46,10 @@ bool checkWin() {
if (board[i][0] == board[i][1] && board[i][1] == board[i][2]) {
return true;
}
if (board[0][i] == board[1][i] && board[1][i] == board[2][i]) { //check column for a win (added)
return true;
}
}



// Check diagonals for a win
if (board[0][0] == board[1][1] && board[1][1] == board[2][2]) {
return true;
Expand Down