One of my projects for this summer is to work out an algorithm for winning Mancala. Really, Mancala is a very simple game. At any given time, a player has a maximum of six possible moves, which makes it strategically much easier and much more basic than a complex game like chess or scrabble.

In case anyone reading this doesn’t know the rules of Mancala, I’ll describe the game briefly. The board is set up with the long sides facing the two players and four stones in each of the circular holes. The oval holes at the ends are the mancalas; each player’s mancala is the one on the right side from his or her perspective. In each move, a player picks up the pieces from one of his or her spaces and puts one piece in each subsequent space, moving in a counterclockwise direction around the board. They put a piece in their own mancala if they pass it, but they skip over their opponent’s mancala. If the last piece ends in the mancala, the player gets to move again. If the last piece ends in a space that had been empty before then, and it is across from a space in which the opponenet has pieces, all of the pieces in those two spaces go into the mancala and the player gets another move. After every move that does not end in the mancala and is not a capture, it is the other player’s turn. The game continues until one player has no pieces in any of his or her six spaces. Then the other player puts all of the pieces on his or her side into their mancala and both players count how many pieces are in their mancalas. The player with the most wins.

For the most part, the strategy is pretty obvious and straightforward. Whenever you have a move that will end in your mancala or that will result in a capture, it’s a good move. You always want to be aware of how many pieces are in each space because you don’t want to let your opponent make a capture. It’s good strategy to have a few empty spaces on your side at any given time so that your opponent will be forced to make certain moves to avoid having pieces captured. My strategy, which generally works well, is to accumulate a lot of pieces in a couple spaces and then to not move them unless it’s necessary. It’s safer and gives you more control when you have more pieces on your side of the board than your opponent has on theirs, but it does mean that you’ll lose if they can get a capture. The strategy is simple enough that, if both players are fairly good, the person who goes first will almost always win. My project now is to develop a more specific strategy that is infallible and always wins, if such a strategy exists.

So basically, this summer, I’m going to play a whole lot of Mancala and write down every game. I haven’t bothered to calculate the exact number of possible games, but I’ve estimated it to be a little under 10 million based on the average length of a game and the number of possible moves at any given time. Obviously, I’m not going to play out all 10 million of those games, but I will need to play at least a couple thousand. There probably is a faster way to develop this algorithm, but I’m too lazy to figure out what it is.

If that sounds like an incredibly nerdy way to spend my free time this summer, I’ll have you know that I am planning to do a lot of other stuff, too. Like writing science fiction and reading a lot and playing lots of online chess and scrabble and making a new list of favorite songs (This one will be either the top 200 or the top 250, I haven’t decided yet) and developing a system for quantifying emotions and doing scientific experiments to determine how I learn best and… actually, I guess we’re going to just have to face the fact that I’m totally going to be a nerd this summer.

Advertisements