Nine Men’s Morris against the computer
Nine Men’s Morris: place your nine pieces, form mills of three in a row and take your opponent’s pieces. Whoever is reduced to two pieces, or cannot move any more, loses.
Source: Wikipedia: Mühle (Spiel) – placing, moving and endgame phases, capture rule (tournament rule 2010), solved as a draw (Gasser). Updated: .
How it is calculated
How to play nine men’s morris
The board consists of three nested squares joined at the middle of each side – 24 points in total. Each player has nine pieces; White moves first. The game has three phases:
- Placing: players take turns placing a piece on an empty point until all nine are on the board.
- Moving: each turn you slide one piece along a line to an adjacent empty point. A player who cannot move loses.
- Flying: once a player is down to three pieces, they may move a piece to any empty point. You can switch this rule off above the board.
Three of your pieces in a line form a mill. Whenever you form a mill, you remove one of your opponent’s pieces – but not one that is part of a mill, unless all of their pieces are in mills. A player reduced to two pieces loses.
Controls
- In the placing phase simply tap an empty point.
- In the moving phase tap one of your pieces (green ring if it can move), then a green target point.
- After a mill, the pieces you may take are marked in red.
The three computer levels
- Easy: looks one move ahead and often plays at random.
- Medium: searches three plies and weighs pieces, open mills and mobility.
- Hard: iterative alpha-beta search up to eight plies, capped at about 0.7 seconds per move.
Tips and background
- During placing, prefer the junctions in the middle of the sides over the corners – they offer the most moves.
- A double mill (running mill) lets you open and close a mill every turn and usually decides the game.
- Nine men’s morris is solved: with perfect play from both sides it is a draw (Ralph Gasser, ETH Zurich, 1993/1996).
Honest limits
Here a game is drawn after a threefold repetition of the same position or after 50 moves without a capture – our own simplification; official tournament rules may differ. The computer uses no opening book or endgame database, so it can be beaten.
Storage and privacy
Settings and your record against the computer are kept in your browser’s localStorage (key muehle). Nothing is sent to a server.
More board games: checkers, chess against the computer and four in a row.
Frequently asked questions
What are the rules of nine men’s morris?
Players first place nine pieces each in turn, then move them to adjacent empty points. Three in a line is a mill and lets you remove an opposing piece. A player with only two pieces left, or with no legal move, loses.
Can pieces fly in nine men’s morris?
Under the common rules, yes: a player with only three pieces left may move to any empty point. You can switch this rule off here.
Can you remove a piece from a mill?
Normally not. Only when all of the opponent’s pieces are in mills may one of them be taken.
Is nine men’s morris a solved game?
Yes. Ralph Gasser showed in the 1990s that perfect play by both sides leads to a draw. The computer here does not play perfectly, so you can beat it.
What is the best strategy in nine men’s morris?
Keep your pieces mobile, occupy the junction points early, block your opponent’s open mills and aim for a double mill that you can open and close every turn.
Sources and legal basis
- Wikipedia: Mühle (Spiel) – placing, moving and endgame phases, capture rule (tournament rule 2010), solved as a draw (Gasser)
- Wikipedia: Nine men’s morris – rules, flying, solved game
- Wikipedia: Alpha-beta pruning
- MDN: Crypto.getRandomValues()
As of: · Editorial policy
Related tools
- Play checkers against the computerFree online checkers vs the computer on three levels, or two players on one device. American/English rules plus international 10×10 and five more variants.
- Kalah against the computerPlay Kalah online: sow seeds, chain extra turns and capture your opponent’s pits – against the computer on three levels or two players on one device. Free.
- Play Chess Against the ComputerPlay chess against the computer free in your browser: 8 levels from beginner to very strong, hints, take back, play White or Black. No sign-up needed.
- Play Four in a Row OnlinePlay Four in a Row free in your browser: against the computer on three levels or two players on one device, with a saved score. No sign-up, no app.
- Play tic tac toe onlineTic tac toe online: play the computer (easy, medium, unbeatable), a friend on one device or by link. 3×3, 4×4 and 5×5 boards with score – free, no sign-up.
- Play Solitaire OnlineFree Klondike solitaire in your browser: draw 1 or 3, unlimited undo, hints and a winnable daily deal. Share your time – the link deals the same cards.
- Raffle Picker: Draw Winning Tickets or NamesRaffle picker for ticket numbers or names with multiple entries: draw winners one prize at a time, no repeats, fair and secure, with a shareable result.
- Cricket Score Counter and Online ScoreboardCricket score counter online: tap runs, wickets and extras ball by ball and see score, overs, run rate and, in a chase, runs needed and required rate. Free.
- Random matchup generator and knockout drawRandom matchup generator: paste the teams, tap once and see who plays whom, or draw a full knockout bracket with byes. Share the result link on WhatsApp.