Workshop › Tic-tac-toe › Step 12 of 33
A move puts the current player's mark in a cell, then hands the turn to the other player. We remember whose turn it
is in player and write the move as a function play(index).
```js
let player = 'X'
function play(index) {
board[index] = player
player = player === 'X' ? 'O' : 'X'
}
```player holds whose turn it is.play(index) takes a cell number as a parameter.board[index] = player puts the mark in that cell of the array.board line, write let player = 'X'.play function, above function draw() {.Skills: Game states, Functions
← A color for each mark No playing on a taken cell →