Back to problems

Build a Tic-Tac-Toe App

Algorithm · Whatnot · Medium

Design the state and logic engine for a local two-player Tic-Tac-Toe match played on a fixed 3 x 3 board. You are given a list called commands, processed strictly in order. Each command is either a cell tap written as (row, col), or a board reset written as "reset". At the start, all nine cells are empty and X is the current player. A tap is accepted only when its target cell is empty and the game has not already ended. After an accepted tap, the mark is placed in that cell,…

Checking your access…