Mancala against the computer

Play Mancala (Kalah) online against the computer: sow the seeds, bank them in your store and capture the pit facing yours. Free, no sign-up, in the browser.

What this game is

Mancala is not one game but a whole family, the oldest of anything played on this site. The board is a row of holes in the ground, and the pieces are pebbles or seeds.

The version here is Kalah: six pits a side, four seeds in each and a store at either end. A move looks disarmingly simple — pick up a handful, drop them one at a time anticlockwise — but the whole game grows out of that.

It comes down to two rules. Land your last seed in your own store and you move again, and such chains can run five or six turns long. Land it in an empty pit of yours and you capture everything facing it, sometimes a dozen seeds at once. Games are decided by whoever counts those two things further ahead.

Rules

How to play better

A bit of history

Mancala is probably the oldest game mechanic still in use. Rows of carved holes turn up all over Africa and the Middle East, the oldest of them thousands of years old, and the game is still played today under hundreds of names: awari, oware, bao, congkak.

Kalah is the twentieth-century American version: its rules were fixed and patented by William Julius Champion Jr., and it is this variant that ended up in school board-game sets.

Mancala turned out to be a good target for computers. Kalah with six pits and four seeds was solved in 2000: with perfect play the first player wins. Awari, the stricter African variant, fell in 2002 to John Romein and Henri Bal, who enumerated all 889 billion positions and proved the game a draw. Awari is listed in our reference of solved games.

About the levels

Easy looks exactly one move ahead. It takes whatever pays most right now: an extra turn first, then a capture, then plain seeds banked. What the position looks like afterwards it never checks — so it keeps filling the pit you are about to sweep.

Hard builds an eight-move tree with alpha-beta cut-offs. The tree has a quirk in Kalah: a move ending in your own store does not pass the turn, so that branch continues with the same player and costs no depth — chains of extra turns are searched whole, however long they run.

Expert is the same search with time-limited deepening: six moves, then seven, and so on for about a third of a second. It scores mostly by the difference between the stores, with small bonuses for seeds still on its own side and for pits that would earn an extra turn. Late in the game, with few seeds left, it reads the position to the very end and stops making mistakes.

Where to go from here