Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

AI_Assignment

Assignment for Chess AI framework implementing Minimax and Alpha-Beta pruning search strategies.
Slides Open Slides


Features

  • 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 strength
    • E(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

Installation

# 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.txt

Usage

Run the main play script:

python3 play_game.py

Code Structure

AI_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

Anuj Sharma CS22B007

Jyothiraditya CS22B002


About

Assignment 3

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages