Browse Source

Clarify tutorial

main
dan 2 years ago
committed by GitHub
parent
commit
f37ef36b07
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/content/learn/tutorial-tic-tac-toe.md

2
src/content/learn/tutorial-tic-tac-toe.md

@ -1522,7 +1522,7 @@ body {
### Declaring a winner {/*declaring-a-winner*/}
Now that you show which player's turn is next, you should also show when the game is won and there are no more turns to make. To do this you'll add a helper function called `calculateWinner` that takes an array of 9 squares, checks for a winner and returns `'X'`, `'O'`, or `null` as appropriate. Don't worry too much about the `calculateWinner` function; it's not specific to React:
Now that the players can take turns, you'll want to show when the game is won and there are no more turns to make. To do this you'll add a helper function called `calculateWinner` that takes an array of 9 squares, checks for a winner and returns `'X'`, `'O'`, or `null` as appropriate. Don't worry too much about the `calculateWinner` function; it's not specific to React:
```js App.js
export default function Board() {

Loading…
Cancel
Save