Workshop › Connect Four › Step 12 of 38
Two players take turns. turn is 1 (red) or 2 (yellow); after each move turn = 3 - turn switches it without an if:
3 − 1 is 2 and 3 − 2 is 1.
```js
let turn
turn = 1
board[row][col] = turn
turn = 3 - turn
```reset starts with red (1). play puts the current player's disc and passes the turn.let board write let turn; in reset, under board = ..., write turn = 1.play, put turn instead of 1 and switch the turn after it.Skills: Game states
← Play a column Click to play →