Skip to content

Commit 1e2bcd7

Browse files
committed
Translate 'Taking turns'
1 parent fdd0b39 commit 1e2bcd7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,9 +1363,9 @@ On myös toinen etu muuttumattomuudessa. Oletuksena, kaikki lapsikomponentit ren
13631363
13641364
### Vuorojen ottaminen {/*taking-turns*/}
13651365
1366-
It's now time to fix a major defect in this tic-tac-toe game: the "O"s cannot be marked on the board.
1366+
Nyt on aika korjata suuri vika tässä ristinolla-pelissä: "0":a ei voi merkitä pelilaudalle.
13671367
1368-
You'll set the first move to be "X" by default. Let's keep track of this by adding another piece of state to the Board component:
1368+
Asetat ensimmäisen siirron oletuksena "X":ksi. Pidetään kirjaa tästä lisäämällä toinen tilamuuttuja `Board` komponenttiin:
13691369
13701370
```js {2}
13711371
function Board() {
@@ -1376,7 +1376,7 @@ function Board() {
13761376
}
13771377
```
13781378
1379-
Each time a player moves, `xIsNext` (a boolean) will be flipped to determine which player goes next and the game's state will be saved. You'll update the `Board`'s `handleClick` function to flip the value of `xIsNext`:
1379+
Joka kerta kun pelaaja siirtää, `xIsNext` (totuusarvo) käännetään määrittämään kumpi pelaaja siirtää seuraavaksi ja pelin tila tallennetaan. Päivität `Board` komponentin `handleClick` funktion kääntämään `xIsNext` arvon:
13801380
13811381
```js {7,8,9,10,11,13}
13821382
export default function Board() {
@@ -1400,15 +1400,15 @@ export default function Board() {
14001400
}
14011401
```
14021402
1403-
Now, as you click on different squares, they will alternate between `X` and `O`, as they should!
1403+
Nyt kun klikkaat eri neliöitä, ne vaihtelevat `X` ja `0` välillä, kuten niiden pitäisi!
14041404
1405-
But wait, there's a problem. Try clicking on the same square multiple times:
1405+
Mutta hetkonen, tässä on ongelma. Kokeile klikata samaa neliötä useamman kerran:
14061406
1407-
![O overwriting an X](../images/tutorial/o-replaces-x.gif)
1407+
![0 ylikirjoittaa X:n](../images/tutorial/o-replaces-x.gif)
14081408
1409-
The `X` is overwritten by an `O`! While this would add a very interesting twist to the game, we're going to stick to the original rules for now.
1409+
`X` ylikirjoitetaan `0`:lla! Vaikka tämä lisäisikin mielenkiint0isen käänteen peliin, pysytään alkuperäisissä säännöissä toistaiseksi.
14101410
1411-
When you mark a square with a `X` or an `O` you aren't first checking to see if the square already has a `X` or `O` value. You can fix this by *returning early*. You'll check to see if the square already has a `X` or an `O`. If the square is already filled, you will `return` in the `handleClick` function early--before it tries to update the board state.
1411+
Kun merkitset neliön `X`:llä tai `0`:lla, et ensin tarkista onko neliöllä jo `X` tai `0` arvoa. Voit korjata tämän *palaamalla aikaisin*. Tarkistat onko neliöllä jo `X` tai `0` arvo. Jos neliö on jo täytetty, `return` `handleClick` funktiossa aikaisin--ennen kuin se yrittää päivittää pelilaudan tilaa.
14121412
14131413
```js {2,3,4}
14141414
function handleClick(i) {
@@ -1420,7 +1420,7 @@ function handleClick(i) {
14201420
}
14211421
```
14221422
1423-
Now you can only add `X`'s or `O`'s to empty squares! Here is what your code should look like at this point:
1423+
Nyt voit lisätä vain `X` tai `0` tyhjille neliöille! Tässä on mitä koodisi tulisi näyttää tässä vaiheessa:
14241424
14251425
<Sandpack>
14261426

0 commit comments

Comments
 (0)