mediumReact Native#133

Tic-Tac-Toe (Ta-Te-Ti)

Prompt

Implement the win-detection logic for Tic-Tac-Toe.

Write a function checkWinner(board) that takes a flat array of 9 cells (X, O, or null) and returns "X", "O", or null. Winning combinations: 3 in a row, column, or diagonal.

Live Preview

Turn: X

Hints

Solution

Your Code

15 min

Tests

Click Run to test your code