Assignment for Chess AI framework implementing Minimax and Alpha-Beta pruning search strategies.
Slides
Open Slides
-
Minimax Search (
minimax.py):- Pure minimax with optional move-ordering (captures first)
- Randomized move exploration for diversity
-
Alpha-Beta Pruning (
alphabeta.py):- Standard alpha-beta search with cut-offs
- Efficient branch pruning to accelerate deep searches
-
Evaluation Module (
evaluate.py):evaluate_board(board)— full-board heuristic for positional strengthE(board)— streamlined evaluation for terminal/depth-limit positions
-
Play Script (
play_game.py):- Command-line interface to pit two AI agents (Minimax vs Alpha-Beta) or AI vs. human
# 1. Clone this repository
git clone https://github.com/The0winner0/AI-Assignment.git
cd AI_Assignment
# 2. Create a virtual environment
python3 -m venv venv
# 3. Activate the environment
# On Linux/macOS:
source venv/bin/activate
# On Windows:
venv\Scripts\activate
# 4. Install dependencies
pip install -r requirements.txtRun the main play script:
python3 play_game.pyAI_Assignment/
├── evaluate.py # Board evaluation functions: evaluate_board, E
├── minimax.py # `minimax(env, board, depth, is_maximizing, use_randomness)`
├── alphabeta.py # `alphabeta(env, board, depth, alpha, beta, is_maximizing)`
├── play_game.py # Main CLI for running matches
├── requirements.txt # Python package dependencies
└── README.md # Project overview and instructions