You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/learn/tutorial-tic-tac-toe.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1729,19 +1729,19 @@ Lopullisena harjoituksena, tehdään mahdolliseksi "aikamatkustus ajassa taaksep
1729
1729
1730
1730
### Pelin siirtojen tallentaminen {/*storing-a-history-of-moves*/}
1731
1731
1732
-
If you mutated the `squares`array, implementing time travel would be very difficult.
1732
+
Jos mutatoit `squares`taulukkoa, aikamatkustuksen toteuttaminen olisi hyvin vaikeaa.
1733
1733
1734
-
However, you used`slice()` to create a new copy of the `squares`array after every move, and treated it as immutable. This will allow you to store every past version of the `squares`array, and navigate between the turns that have already happened.
1734
+
Kuitenkin, jos käytit`slice()`:a luodaksesi uuden kopion `squares`taulukosta jokaisen siirron jälkeen, ja käsitellä sitä muuttumattomana. Tämä antaa sinun tallentaa jokaisen edellisen version `squares`taulukosta, ja navigoida niiden välillä, jotka ovat jo tapahtuneet.
1735
1735
1736
-
You'll store the past `squares`arrays in another array called `history`, which you'll store as a new state variable. The `history`array represents all board states, from the first to the last move, and has a shape like this:
1736
+
Tallennat aikaisemmat `squares`taulukot toiseen taulukoon nimeltään `history`, jonka toteutat uutena tilamuuttujana. `history`taulukko edustaa kaikkia pelilaudan tiloja, ensimmäisestä viimeiseen siirtoon, ja sillä on tämän kaltainen muoto:
0 commit comments