Skip to content

Commit

Permalink
When no one wins, display a message about the result being a draw.
Browse files Browse the repository at this point in the history
  • Loading branch information
mydeveloperplanet committed Sep 12, 2020
1 parent 88f9226 commit aac5af9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.js
Expand Up @@ -116,6 +116,8 @@ class Game extends React.Component {
let status;
if (winner) {
status = 'Winner: ' + winner.square;
} else if (this.state.stepNumber === 9) {
status = 'It is a draw';
} else {
status = 'Next player: ' + (this.state.xIsNext ? 'X' : 'O');
}
Expand Down

0 comments on commit aac5af9

Please sign in to comment.