The Tic Tac Toe kata


Discuss this kata. Post solutions, ask for feedback.

Tic Tac Toe rules:

  • X always goes first.
  • Players alternate placing X’s and O’s on the board.
  • Players cannot play on a played position.
  • A player with three X’s or O’s in a row (horizontally, vertically, diagonally) wins.
  • If all nine squares are filled and neither player achieves three in a row, the game is a draw.