This python application allows users to play a game of Twisted Mancala (with different rules from the original game, but the same board) with a Minimax AI. The user can pick the move from the terminal and see the board visually on a separate window.
This project utilizes only the Python Standard Library.
To start up the application, from within the root directory:
python3 src/mancala.py
This game shares the same board and number of pebbles as mancala, but the rules are slightly different.
- When the player chooses a pit, the player picks up all of the pebbles in the chosen pit and drops one pebble into the next pits, excluding the opponent's store. The order of the pits go from pit 0 to pit 12, 0 being the player 1's first pit and going counter clockwise on the board (pit 12 is the player 1's store).
- When the player runs out of the pebbles in hand, the player can pick up the pebbles from the last pit the last pebble was dropped into.
- Step 2 repeats until the last pit the player dropped the pebble into did not contain any pebbles. If the player drops the last pebble into an empty pit, the player's turn ends.
- Player 1 and 2 alternate turns until none of the pebbles are available in the pits.
- Whoever has more pebbles in ther store is the winner of the game.
Once the application is launched through the terminal, the player can see the board as shown below.
The player will control the moves through the terminal. The shell will print,
###########################
# ~ Let's play Mancala! ~ #
###########################
-----It is player 0's turn.-----
Pick a pit number [0, 1, 2, 10, 11, 12] to sow pebbles:
When the player inputs the move, the pebbles in the board will start to move.
As soon as the player's turn is over, the AI will make its move. The pit chosen by the AI can be viewed below
###########################
# ~ Let's play Mancala! ~ #
###########################
-----It is player 0's turn.-----
Pick a pit number [0, 1, 2, 10, 11, 12] to sow pebbles: 2
The computer has chosen pit number 9
Twisted Mancala uses the PEP 8 -- Style Guide for Python Code.
Twisted Mancala uses the MIT License.