Mancala Game

mancala.jpg

Installation

  • Click on the buttons with numbers on them, they represent bins with beads in them. You can change options about rules and computer play.

mancala_options.jpg

Rules of the Game

  • THE REAL GAME: The buttons represent the bins carved into a wooden block, and the numbers represent the stones placed in these bins.
  • 2 PLAYERS: Player1 controls the bottom row of bins and has the store on the right, player2 controls the top row, and owns the other store.
  • MOVE: On your turn, you take the stones in one of your six bins; and drop them one by one, starting with the next bin or store, proceeding counter-clockwise. [option: you do not drop into opponent's store.]
  • FREE MOVE: If the last stone lands in your store, you go again. * STEAL: If the last stone lands in an empty space on your side, you take the stones that are across from it on your opponent's side, and put them into your store. [option: you steal the piece that landed in the empty space.]
  • END: When all the bins on one side become empty, the game ends. * RESULT: Whoever has more stones in his/her/its store, wins.

Program Features

  • This program is written using MSVC 6.0, as an excercise, while learning MFC and practicing my AI skills.
  • The search engine uses an Alpha-Beta Pruned Search Algorithm.
  • The evaluation function for a position is the difference in the stores, plus the maximum possible immediate gains, before the opponent gets his turn.
  • To simulate the human play, a randomness variable is introduced for selection of moves. When randomness=0, a move is selected among only the best moves. As randomness increases, the good moves loose weight.
  • When the auto-adjust option is on, the computer adjusts its strength in order to minimize the difference b/w the storages.
  • This is a single-threaded application. So, do not expect to get a response from your mouse inputs while the engine is searching.