Play free Nine Men's Morris against the computer at three levels, or with a friend on the same screen. Place, slide and fly pieces to make mills.
Amber 9
9 in hand, 0 on the board
Violet 9
9 in hand, 0 on the board
Your move (Amber): place a piece
Session You 0, Computer 0, Draws 0
Most pieces kept -
Wins 0
Quiet moves 0 of 40
Each side has nine pieces. First take turns placing them on the points where lines meet. Three of your pieces in a straight line is a mill, and a mill lets you take one of the other side's pieces, but not one that is itself in a mill unless every piece is. When all pieces are placed, slide a piece along a line to the next empty point. A side down to three pieces may fly to any empty point. You lose when you are down to two pieces or cannot move. The game is drawn after 40 moves in a row, by both sides together, with no piece placed or taken. Amber pieces are plain discs and Violet pieces have a ring. Click a point to place, click a piece and then a marked point to move, and click a highlighted piece to take it. Arrow keys move around the board, Enter or Space acts, Escape lets go of a selected piece or cancels a move that is waiting for a piece to be taken.
Easy picks any legal move at random, including which piece to take after a mill. Medium searches 3 moves ahead with alpha-beta pruning. Hard searches up to 5 moves ahead, one move deeper at a time, and stops deepening after about 0.4 of a second. Both score a position by pieces (those on the board and those still in hand count the same), the mills each side holds, lines where a side needs just one more piece, and how many moves each side has. Moves that close a mill or block one are tried first. It is a fixed search with no learning and no opening book, so a careful player can beat it. Undo takes back your last move and the reply, and a game that used Undo is not counted as a result. Undo is not available once a game is over.
As-is, no warranty. These apps are free under their listed license and run entirely in your browser. Use at your own risk — don't blame me if your PC catches fire, your dog runs away, or the math turns out wrong. Verify anything that actually matters. None of this is professional financial, medical, legal, or engineering advice.
The board is three squares, one inside the other, joined by four lines through the middle of their sides. The 24 places where lines meet are the points. Each side has nine pieces. Amber moves first, and Amber pieces are plain discs while Violet pieces have a ring in the middle, so the two sides do not rely on colour alone.
The game has three phases:
Three of your pieces in a row along one line is a mill. Whenever you make a mill, by placing, sliding or flying, you take one of the other side’s pieces off the board. You may not take a piece that is itself in a mill, unless every piece the other side has on the board is in a mill. Making two mills with one move still takes just one piece. Moving a piece out of a mill and back in later makes a new mill. If the other side has no piece on the board at all when you make a mill (they have only pieces in hand), there is nothing to take.
You lose when you are down to two pieces, counting the ones still in your hand, or when it is your turn and none of your pieces can move. The game is drawn after 40 moves in a row, counting both sides together, with no piece placed or taken. The page shows that count.
Controls:
To place a piece, click an empty point. To move, click one of your pieces (pieces that can move have a dashed outline), then click a marked point. After a mill, the pieces you may take are highlighted; click one. The last move is outlined and the point where a piece was taken is ringed. On the keyboard, arrow keys move to the nearest point in that direction, Enter or Space acts, and Escape puts a piece down. Every point is announced with its place on the board, what is on it and what you can do there, and the status line says what each move did. The page address carries the opponent, difficulty and side.
Points are numbered by square and position: 0 to 7 clockwise from the top-left corner on the outer square, 8 to 15 on the middle square and 16 to 23 on the inner one. Each point is linked to its two neighbours on its own square, and each middle-of-a-side point is also linked to the same point on the next square in or out. The 16 lines are the four sides of each square and the four lines that join the squares.
The test suite pins the rules in several ways:
The computer has three levels:
Both searches score a position by material first (a piece in hand counts like a piece on the board), then by the mills each side holds, the lines where a side needs just one more piece, and how many moves each side has. A lost position scores below any of those and a won one above. Moves that close a mill, and moves that block a mill the opponent threatens, are tried first so that pruning cuts more. Moves that tie for best are chosen between at random.
The alpha-beta search is checked against a plain minimax with no pruning, which gives the same value at depths 1 and 2 for more than 40 positions from random games, and at depth 3 where the move list is short. In the test suite, with the first move alternating, Medium won at least 5 of 6 games against Easy, and so did Hard searching 4 moves ahead. In a position where closing a mill wins the game, Medium and Hard close it, and in a position where losing a piece would lose the game they block the mill; the suite checks one of each. The suite asserts that Hard answers every position it is asked about in under 4 seconds, a bound loose enough for a slow machine; the design limit is about 0.4 of a second. The computer waits about 0.45 seconds before moving so you can follow along, and moves at once if you have asked for reduced motion.
Nothing is uploaded and there is no account. Against the computer, your win count and the most pieces you kept in a win, for each difficulty, are saved in your browser’s local storage, as small whole numbers inside a small JSON object, under one key. Clearing site data removes them. The session tally lives only on the page and resets when you leave it. Two-player games are not saved.
Only finished games count. A game in which you used Undo is not counted against the computer, so the saved figures are not inflated.
Everything runs locally in your browser.
For informational purposes only. Not financial, medical, or legal advice. You are solely responsible for how you use these tools.