Public Group

# Still ... mancala

This topic is 5390 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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.

##### Share on other sites
What's a heuristic?

##### Share on other sites
Quote:
 Original post by SSJCORYWhat's a heuristic?

it's a big word for a strategy or method.

##### Share on other sites
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.

##### Share on other sites
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.

##### Share on other sites
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.

##### Share on other sites
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.

• 18
• 20
• 12
• 21
• 16