Pregunta de entrevista de Raylo

Implement a game of tic-tac-toe

Respuesta de la entrevista

Anónimo

19 ene 2026

Create an array of winning index permutations e.g. [“0,1,2”, “3,4,5”, “6,7,8”…. etc] Create an array for each player to store the indices of the squares they’ve picked. After each turn, check if the players’ array matches one of the winning permutations. If it does, update the state of the game and output the winner on screen.