Thameur Portfolio

Mancala Game ๐ŸŽฎ

June 15, 2022 (2y ago)

๐ŸŽฎ A Python-based implementation of the classic African board game Mancala, offering AI profiles for optimized play and strategy.

๐Ÿ’ป Source Codeย ย โ€ขย 
Mancala Game: AI and Strategy
Mancala Game: AI and Strategy

๐Ÿ“ Abstract

This Mancala game is a Python implementation of the classical African board game. It features two AI profiles: one that optimizes for free turns and captures and another that randomly selects moves. The game can be played between two players or with the AI, making it an ideal starting point for developing more advanced AI strategies for board games.

๐ŸŒŸ Features

  • Two AI Profiles: Optimized AI based on free turns and captures, and a random AI.
  • Player vs AI: Play against an AI with different skill levels.
  • Graphical Interface: Simple graphical interface for a better user experience.
  • Mancala Game Logic: Accurate rules for capturing, sowing, and turning stones.
  • Easy Setup: Run the Python script to start playing Mancala.

๐Ÿš€ Getting Started

Prerequisites

Before you can run this project, ensure the following packages are installed:

  • Python 3.x
  • Pygame (for graphical interface)

Installation

  1. Clone the repository:
git clone https://github.com/verus56/Mancala-game cd Mancala-game
  1. Install required dependencies:
pip install pygame

Running the App

To start playing the game:

python main.py

To play against the AI:

python play.py

๐Ÿค– How It Works

  1. Game Logic: The Mancala game rules are implemented, including sowing and capturing stones.
  2. AI Profiles: The AI profiles make decisions based on two strategies: a vector-based approach that optimizes for free turns and captures, and a simple random AI.
  3. Graphical Interface: The game uses Pygame to display the board and game state interactively, allowing players to make moves.

๐Ÿ“Š Technical Stack

  • Game Engine: Pygame (for the graphical interface)
  • AI Profiles: Simple random AI, vector-based AI for optimized gameplay
  • Language: Python

๐Ÿ› ๏ธ Deployment

This system can be run locally on any machine with Python and Pygame installed to play Mancala against either a human player or the AI.

๐Ÿ“ License

Released under the MIT License.

๐Ÿ“ฒ Contact

Made with โค๏ธ by Hamzaoui Thameur