This project implements the traditional Mancala board game in Java, incorporating advanced features such as AI-based strategies, saved games, and an interactive interface for two-player or single-player modes. Mancala is a centuries-old African game that involves strategy and skill to capture the maximum number of stones.
- Professor M'hamed AIT KBIR
Description: This is the entry point of the game, where users are greeted with a welcome screen and options to proceed.
Description: Customize your game settings, including opponent type (human or AI), game complexity, strategy, and heuristic.
Description: Displays the rules of Mancala, helping new players understand how to play.
Description: The main gameplay area. Players can interact with the pits and see their moves visualized.
- Two-player mode: Play with a friend locally.
- Single-player mode: Compete against a machine using intelligent strategies.
- AI assistance: Request hints during the game (limited number of times).
- Game saving and resuming: Save your game progress and continue later.
- Replay functionality: Review saved games to analyze strategies.
- Customizable difficulty: Adjust the AI's complexity to suit your skill level.
- Multiple heuristics: Implements at least two AI heuristics for enhanced gameplay.
-
Game Board:
- The board consists of two rows of six small pits, with a larger "store" pit on each side.
- Players aim to collect the most stones in their store pit.
-
Turn Mechanics:
- Players select one of their pits and distribute its stones clockwise, one at a time.
- Stones can be placed in the playerโs store but not in the opponent's store.
- Captures occur if the last stone lands in an empty pit on the playerโs side.
-
Special Cases:
- Players earn an extra turn if their last stone lands in their store.
- The game ends when all pits on one side are empty. Remaining stones go to the respective store pits.
-
Winning:
- The player with the most stones in their store wins.
- Implements adversarial search algorithms like Minimax and Alpha-Beta Pruning for the AI.
- Two distinct heuristics are available to evaluate game states and enhance the AI's decisions.
- Object-Oriented Programming:
- Respects principles like inheritance and encapsulation.
- Utilizes a modular design for board, player, and AI components.
- Alpha-Beta Pruning:
- Customized implementation replacing
alphaBetaHelper(...)
based on course requirements.
- Customized implementation replacing
- Games can be saved and resumed using a structured file format.
- Saved games can be replayed for analysis.
- Clone the repository:
git clone https://github.com/son-of-mountain/mancala-game.git cd mancala-game