Still ... mancala

Started by
5 comments, last by johnhattan 19 years, 6 months ago
Hi everyone, what is a good heuristic for mancala? I am in the process of writing evaluate(), but not sure how to go about it. At first I thought it can be based on the dufference between two homebins, then on difference in total number of stones on a side of each player, but that does not seemt to work out well. Any advice is very much appreciated.
Advertisement
What's a heuristic?
Favorite Quotes:Gandalf: You cannot pass!|Smeagol: We don't need you!|Sloth: Hey you guys!|
Quote:Original post by SSJCORY
What's a heuristic?

it's a big word for a strategy or method.
I'd say write down the logic on paper whatever the problem solving strategy and then use that to formulate your code. Works well for me. I can't really help since I don't know anything about mancala.
Favorite Quotes:Gandalf: You cannot pass!|Smeagol: We don't need you!|Sloth: Hey you guys!|
A straight minimax search works very well for Mancala because the number of moves you can make during a turn is very limited (usually six or fewer). You can make a really deep tree and get a pretty unbeatable game without much work.

(my byline from the Gamedev Collection series, which I co-edited) John Hattan has been working steadily in the casual game-space since the TRS-80 days and professionally since 1990. After seeing his small-format games turned down for what turned out to be Tandy's last PC release, he took them independent, eventually releasing them as several discount game-packs through a couple of publishers. The packs are actually still available on store-shelves, although you'll need a keen eye to find them nowadays. He continues to work in the casual game-space as an independent developer, largely working on games in Flash for his website, The Code Zone (www.thecodezone.com). His current scheme is to distribute his games virally on various web-portals and widget platforms. In addition, John writes weekly product reviews and blogs (over ten years old) for www.gamedev.net from his home office where he lives with his wife and daughter in their home in the woods near Lake Grapevine in Texas.

Yeah, that's what I have. My problem is implementation of the evaluate() which is the base for the minimax. More specifically, it probably has to be based on the difference of the stones in each homebin (or score bin), but that would mean building a tree until the game is over for one of the players. Complexity of that is quite high (6^n) and I am not sure how to determine depth. Another thing, is alpha-beta prunning going to improve the search much in terms of time? Or is simple minimax sufficient enough?

Thanks a lot.
Alpha-beta pruning will generally improve your search speed by 20-30% by eliminating travels down pointless branches. Given that pruning just requires a couple of if() statements, it's well worth it.

(my byline from the Gamedev Collection series, which I co-edited) John Hattan has been working steadily in the casual game-space since the TRS-80 days and professionally since 1990. After seeing his small-format games turned down for what turned out to be Tandy's last PC release, he took them independent, eventually releasing them as several discount game-packs through a couple of publishers. The packs are actually still available on store-shelves, although you'll need a keen eye to find them nowadays. He continues to work in the casual game-space as an independent developer, largely working on games in Flash for his website, The Code Zone (www.thecodezone.com). His current scheme is to distribute his games virally on various web-portals and widget platforms. In addition, John writes weekly product reviews and blogs (over ten years old) for www.gamedev.net from his home office where he lives with his wife and daughter in their home in the woods near Lake Grapevine in Texas.

This topic is closed to new replies.

Advertisement