Mancala (Kalah)

Sow stones anticlockwise; land in your store and go again. That one rule is why Kalah is a proven first-player win.

The extra turn is what makes it a game

Land your last stone in your own store and you move again. That one rule turns a counting exercise into a tactical one, because a single turn can chain into several — and from the standard opening the first player can start such a chain immediately. Kalah with six pits and four stones was solved in 2000 and is a first-player win, largely for that reason.

The second decisive rule is the capture: land your last stone in an empty pit on your own side and you take it along with everything in the pit opposite. Both rules are easy to state and easy to implement wrongly, which is why the tests here assert them directly — including that you never sow into your opponent's store, and that when either side empties, the other sweeps its remaining stones into its own store rather than leaving them on the board.

Exactly one opening move gives you a second turn

Every pit starts with 4 stones and sowing drops one in each cup going anticlockwise. From the third pit those 4 stones land in pits four, five, six and then your store — so the last one banks and you go again. The arithmetic picks the move for you.

Sow fromLast stone landsResult
pit 1 in your pit 5 turn passes
pit 2 in your pit 6 turn passes
pit 3 in your store another turn
pit 4 in your opponent's pit 1 turn passes
pit 5 in your opponent's pit 2 turn passes
pit 6 in your opponent's pit 3 turn passes

One move out of six, and it banks a stone on the way. It is not a subtle opening choice — every strong Kalah line starts there. The game is a proven first-player win, solved by Irving, Donkers and Uiterwijk in 2000. That is a result from the literature rather than something this page computes; what the page can show you is the arithmetic underneath it.

But the chain stops at one, and only at the start

After that opening the board reads 4, 4, 0, 5, 5, 5 with one stone banked, and the pit you emptied is no longer a legal move. Five moves remain and not one of them lands in the store again. The free turn is worth having and it does not compound: searching every continuation gives a chain of exactly 1.

Later it is a different game entirely. Searching every position within 4 plies of the start — 1,169 of them — chains of up to 9 consecutive free turns are reachable. That is more than the 6 pits on your side, so such a turn has to run through cups refilled during the chain itself. So the opening is forced and the middlegame is not, which is roughly the opposite of how most abstract games feel. Setting up a long chain is the whole tactical content, and it takes a few moves before it becomes possible at all.

Nothing is ever created or destroyed

48 stones start on the board and 48 remain after any number of moves, checked across a dozen different lines of a hundred plies each. A capture moves stones between cups — it never removes them — so the total is a running invariant of the whole game. That makes it the single most useful thing to check in an implementation: any mistake in the sowing or the capture shows up immediately as a stone count that has drifted, long before it shows up as a game that plays oddly.

How to use

  1. Tap one of your pits to sow its stones anticlockwise, one per pit.
  2. Land your last stone in your own store and you move again.
  3. Land in an empty pit on your side and you capture the pit opposite.
  4. When either side empties, the other sweeps its remaining stones.

Frequently asked questions

How do you play mancala?

Pick one of your six pits and sow its stones one at a time into the following pits, moving anticlockwise, skipping your opponent store. Two rules decide games: landing your last stone in your own store gives you another turn, and landing in an empty pit on your own side captures that stone plus everything opposite.

What is the extra turn rule?

If your last sown stone lands exactly in your own store, you move again immediately. It is what turns the game from a counting exercise into a tactical one, because a single turn can chain into several — and setting up such chains, or denying them, is most of what good play consists of.

Is there a first-player advantage?

Yes, and it is proven. Kalah with six pits and four stones each was solved by Irving, Donkers and Uiterwijk in 2000, and the first player wins with perfect play. The reason is the extra-turn rule — the opening position lets the first player begin a chain straight away, and that tempo never comes back.

How does capturing work?

If your last stone lands in a pit on your own side that was empty before it arrived, you capture that stone together with every stone in the pit directly opposite, and both go to your store. If the opposite pit is empty there is nothing to take and your stone simply stays where it landed.

Do you sow into your opponent store?

No, never. You skip it entirely and carry on into their pits, which is why a long sowing can pass all the way round the board and back into your own side without ever adding to their score. Getting this wrong is one of the commonest implementation errors in the game.

How does the game end?

As soon as either player has no stones left in any of their six pits. The other player then sweeps all their remaining stones into their own store, and whoever has more stones wins. That sweep means a player who runs out of stones early can still lose heavily.

What is a good opening move?

In the standard four-stone game, the pit that lands exactly in your store — because it gives you another turn immediately and costs nothing. Beyond that, think about not leaving your pits vulnerable to a capture, which means paying attention to which of your pits are empty and what sits opposite them.

How do you defend against captures?

By watching which of your pits are empty and what is sitting opposite them, because those are the pits your opponent wants to land in. Keeping a stone in a pit denies the capture entirely, and sometimes it is worth sowing a pit early purely to fill an empty one before it becomes a target.

Is it better to hoard stones or move them?

Generally to keep material moving, because stones sitting in your pits are still capturable while stones in your store are not. Hoarding a large pile in one pit is tempting but sows straight into your opponent side when you finally play it, handing them material.

How many variants of mancala are there?

Hundreds, played across Africa, the Middle East and Asia under names like Oware, Bao and Congkak, with quite different rules about capturing, sowing direction and whether stones are relayed. Kalah is the modern commercial version standardised in the United States in the 1940s, and is the one usually meant by mancala in English.

How strong is the computer opponent?

It searches ahead with alpha-beta pruning, and the strength setting controls how many moves deep. Because the extra-turn rule lets the same side move twice in a row, the search has to handle a player moving consecutively rather than alternating, which is a common source of bugs in mancala engines.

Does the game save my progress?

No. Everything runs in your browser, nothing is stored or uploaded, and closing the tab loses the current position.

🔒 This tool runs entirely in your browser. Nothing you enter is uploaded, logged, or stored.