Hexapawn

Martin Gardner’s Mathematical AI Game Brought to Life

The red pieces are yours. They move like chess pawns (but not exactly): They can move one square forward to an empty square and they can capture diagonally. A player wins when one of their pieces advances to the other side of the board or the opponent is in a position with no possible moves. There are no draws; One side will always win and the other will lose.

The computer starts by making random moves and learns as you play. Whenever it loses (or runs into a "dead-end" situation), it adds the previous position to a list of positions to avoid, and won't make moves that lead to any positions on that list. The more the computer plays, the better it gets. Turn on pre-trained mode to play against a computer that already knows the best moves.

Before you start playing, can you figure out which side will win with optimal play?