Skip to content

Conversation

@jsnconnolly
Copy link
Owner

No description provided.

return false;
// checking for Tie
bool tie = false;
if (board[0][0] != " " && board[0][1] != " " && board[0][2] != " " && board[1][0] != " " && board[1][1] != " " && board[1][2] != " " && board[2][0] != " " && board[2][1] != " " && board[2][2] != " ")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you do this with a loop?

/* if cells are empty what happens, make sure empty does not count as win */

bool WonHorizontally = false;
if (board[0][0] == board[0][1] && board[0][1] == board[0][2] && board[0][0] != " " && board[0][1] != " " && board[0][2] != " ")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you do this with a loop?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really need to check that all 3 position in the first row not equal to " "?

{
// your code goes here
board[row][column] = playerTurn;
// your code goes here
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if the position was already filled in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants