Pergunta de entrevista da empresa Raylo

Implement a game of tic-tac-toe

Resposta da entrevista

Sigiloso

19 de jan. de 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.