Mankala

To Play

The mankala game above let's you play south against a Tcl program playing north. You play by clicking on one of the stones in one of the six round pits along the bottom of the board.

Mankala is a game played with stones or seeds on a board with fourteen pits. The south player plays from the six small pits along the bottom of the board and scores stones played into the larger home pit at the right edge of the board. The north player plays from the six small pits along the top of the board and scores stones played into the larger home pit at the left edge of the board.

A play consists of picking up the stones from one of your play pits and sowing them one at a time counterclockwise into your own play pits, your home pit, and your opponents play pits. If the last stone played in a turn lands in your home pit, then you get to play again. If the last stone played lands in an empty play pit on your side of the board, then you capture any stones in the play pit opposite by moving them across the board into your play pit.

The game ends when either player cannot take a turn. You score all stones in your pits. The player with the most stones wins.

Many variations of mankala exist. The rules implemented above incorporate a mutation in the rules that came with the first mankala board I bought, a mutation which lengthens the game.

The Tcl Program

The source for Mankala is 571 lines or 15Kbytes of code. The program was originally written as a standalone Tcl/Tk application, and also exists as a Java applet .

The embed_args accepted by the Tcl Plugin are:
widththe width of the board.
heightthe height of the board.
stonesthe number of stones, which may be 3, 4, 5, or 6.
stone-colorsthe stone coloring, which may be poly or mono.
s-strategythe strategy pursued by the south player.
n-strategythe strategy pursued by the north player.

The available strategies for s-strategy and n-strategy are:
playerplay under interactive control.
FindRandomchoose a random play.
FindFirstchoose the first legal play.
FindLastchoose the last legal play.
FindFirstLargestchoose the first pit with the largest number of stones.
FindLastLargestchoose the last pit with the largest number of stones.
FindFirstSmallestfirst pit with the smallest number of stones.
FindLastSmallestlast pit with the smallest number of stones.
FindGreedy ...play the most continuation moves, ie moves which end by playing into your own home pit, then play the largest capture move, ie moves which end by playing into empty play pit of your own opposite a filled play pit of your opponent's, then play the strategy described by ....

The game above was specified with the markup:

  <embed src=mankala.tcl
    width="500" height="160"
    vspace="25" hspace="25"
    stones="3" stone-colors="poly"
    s-strategy="player"
    n-strategy="FindGreedy FindLast">	


Roger E Critchlow Jr
Last modified: Fri May 16 19:40:01 MDT 2003
elf.org