issues
search
StephenDriffill
/
tech_test_spruce
Implementation of tic-tac-toe for SpuceEco tech test
0
stars
0
forks
source link
Basic working game (P1)
#2
Closed
StephenDriffill
closed
1 month ago
StephenDriffill
commented
1 month ago
[x]
useReducer
for board state
[x] state for current player (X or O) - assume X makes first move
[x] onClick handler to update board and switch player
[x] remove handler / block state update if square is already used
[x] check if player has won after each move e.g.
hasPlayerWon
- prevent more moves, display the winner and prompt to reset
[x] handler to reset the board
[x] Add unit tests for the helper functions (
move
and
getWinner
)
useReducer
for board statehasPlayerWon
- prevent more moves, display the winner and prompt to resetmove
andgetWinner
)