Skip to content

Commit

Permalink
Added a message about a draw #7
Browse files Browse the repository at this point in the history
  • Loading branch information
dannarsavage committed Feb 19, 2022
1 parent 71295cc commit e701b12
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,11 @@ class Game extends React.Component {
if (winner) {
status = 'Winner: ' + winner;
} else {
status = 'Next player: ' + (this.state.xIsNext ? 'X' : 'O');
if (this.state.history.length < 10) {
status = 'Next player: ' + (this.state.xIsNext ? 'X' : 'O');
} else {
status = 'A strange game. The only winning move is not to play. How about a nice game of Global Thermonuclear War?';
}
}

return (
Expand Down

0 comments on commit e701b12

Please sign in to comment.