HEXAPAWN
The game that learns to play itself.
A demonstration on the way Artificial Intelligence is trained.
Invented by Martin Gardner.
Programmed by Nathan Boehm.
White (you) goes first. You can move a pawn forward one space to an empty tile, or diagonally forward one space to capture an enemy pawn.
There are 3 ways to win:
-Move a pawn to the opposite end of the board.
-Capture all enemy pawns.
-Achieve a position in which your opponent cannot move.
You are playing against a machine comprising of 24 matchmoxes, each with a game state printed on it and each containing colored beads.
Every time you move, the matchbox indicating the current game state is found, and a random bead is taken out.
The AI moves following the arrow of whatever color bead is taken.
Every time you win, the bead that caused the AI to lose is taken out of its matchbox.
At first, the AI starts by making random moves that most likely cause it to lose. But over time, it learns from its mistakes, and eventually becomes a perfect player.