← All articles

Hexapawn Rules & History: The Game That Taught a Machine to Learn

Strategy Games · Rules & History · July 16, 2026

Hexapawn looks like a toy version of chess — three pawns a side, a tiny 3x3 board — but it holds a genuinely remarkable place in the history of computing. This is the game literally designed to be small enough for a box of matchsticks to learn how to win it.

How to Play Hexapawn

Hexapawn is a two-player abstract strategy game played on a 3x3 board — essentially the smallest possible chess-like game. Each player starts with three pawns lined up on their own back row, facing their opponent's three pawns across the board.

The rules borrow directly from chess pawn movement, simplified further. On your turn, you may move a pawn straight forward one square into an empty space, or capture an opposing pawn by moving diagonally forward into the square it occupies. There's no double-step opening move, no en passant, and no promotion — Hexapawn strips chess down to its bare minimum moving parts.

You win by achieving any one of three conditions: advancing a pawn all the way to your opponent's back row, capturing every one of your opponent's pawns, or leaving your opponent with no legal move on their turn. Because the board is so small, every game is short, but the decision tree is deep enough to reward careful thinking — with perfect play, the first player can force a win, which is part of what made it such a perfect teaching tool for exploring how a simple system can "solve" a game through trial and error.

The History of Hexapawn

Hexapawn was invented by the American mathematician and popular-science writer Martin Gardner, and first described in his March 1962 "Mathematical Games" column for Scientific American. But Gardner didn't invent it in a vacuum — he was writing about the broader idea of machines that could learn to play games, and Hexapawn was his simplified version of a real machine that already existed: MENACE.

MENACE, short for the Matchbox Educable Noughts And Crosses Engine, was built in 1961 by AI researcher Donald Michie (with colleague Roger Chambers) out of 304 actual matchboxes, each one representing a possible board state in tic-tac-toe. Colored beads inside each matchbox represented candidate moves; after each game, beads for winning moves were reinforced by adding more of the same color, while beads for losing moves were removed. Play enough games, and the matchboxes — with no calculations, no electricity, and no code — gradually got better, exhibiting what is now recognized as one of the earliest working demonstrations of reinforcement learning.

Gardner recognized that tic-tac-toe's move-and-outcome space was still fairly large to illustrate in a magazine column, so he introduced Hexapawn as a smaller, easier-to-follow version of the same trick, sometimes built with a system called HER (the Hexapawn Educational Robot) using the identical matchbox-and-bead method. The result is a rare case of a board game whose entire reason for existing was to make a machine-learning concept understandable to a general audience — decades before "machine learning" was a household term.

Why Hexapawn Still Matters

Today, Hexapawn is often used in classrooms and introductory computer science courses for exactly the reason Gardner and Michie originally cared about it: the entire game tree is small enough to map out completely by hand, yet rich enough to demonstrate real concepts like minimax search, game-tree pruning, and reinforcement learning without needing a computer at all. Students can build their own matchbox-and-bead version in an afternoon and watch it improve over a few dozen games, exactly as Michie's original machine did with tic-tac-toe.

That teaching legacy is arguably more interesting than the gameplay itself. Hexapawn is a rare example of a game whose rules were reverse-engineered specifically to be small enough to solve — a deliberate design choice that makes it a favorite reference point in the history of artificial intelligence, decades before neural networks or deep learning entered the picture.

Why Play Hexapawn on RivalPit

Hexapawn is often called the simplest possible chess-like game — a great entry point if you enjoy compact strategy puzzles. Explore more in our guide to abstract strategy games you can play online, and if the pawn-forward tactics have you hooked, check out our chess opening tips for beginners to build on the same core ideas at a bigger scale.

Think you can outplay Hexapawn?
Try the smallest, sharpest strategy game around — free, right in your browser.
Play Hexapawn free on RivalPit