Dalaoli on Math
Game

Notakto: X-only tic-tac-toe

Tic-tac-toe with a twist: both players place X. A board with three in a row is dead and takes no more moves. Whoever completes a line on the last live board loses. The AI has searched the entire game tree. Can you beat it?

Your XAI's XChanging the number of boards or who moves first starts a new game; the AI strength applies from the next move.

Key facts

Why the Nim method fails

For impartial games under normal play (the last mover wins), each component gets a Grundy value, and a sum of components is solved by XOR-ing those values. That is the Sprague–Grundy theorem, and it is how Nim is solved.

Under misère play this breaks down. With several boards, who makes the last move depends on when each board gets killed, and the parities interact, so a single number per board is not enough.

Plambeck and Siegel introduced misère quotients: under misère play, each board position maps to an element of a finite commutative monoid. For several boards you multiply the elements and check whether the product lands in the "player to move loses" class or the "player to move wins" class. In 2013, Plambeck and Whitehead used this method in "The Secrets of Notakto: Winning at X-only Tic-Tac-Toe" to solve Notakto on any number of 3×3 boards, with a monoid of just 18 elements.

How the AI plays

The perfect AI does not use the monoid. It searches the whole game tree directly: rotations and reflections of a board count as the same position, dead boards are dropped, and that leaves only 46 essentially different live boards, so every position with 3 boards is solved in the browser in an instant. When it can win, it takes the fastest win; when it cannot, it plays the move that lasts longest.

The casual AI plays at random, except that it never completes a line on the last board on purpose.

Comments