Tic-tac-toe (source code)

= Tic-tac-toe
{wiki}

= Noughts and crosses
{synonym}

A two-player <game> on nine positions arranged in a three-by-three grid. Players alternate marking empty positions and stop when one has a full row, column or diagonal, or when the board is full. A game search must stop at the first win. Distinct move histories can reach the same position; canonical occupancy <sets> or <bitboards> make that equality available to <memoization>. Quotienting by board symmetry changes the requested output unless distinct oriented positions are subsequently restored.