Skip to content

A minimax based active information directed tree search model that plays chess ♟️

Notifications You must be signed in to change notification settings

alf-arv/chess-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chess-ai

A minimax based active information directed tree search model that plays chess, created for a University assignment.

Make an attempt at beating it and let me know how you did! ♟️

How it works

Using a variant of Monte-Carlo Tree Search, the chess AI simulates the outcomes of a set of different move choices either until the game ends or until a set tree depth is reached. The path leading to the best resulting game state is strengthened using backpropagation. Since chess pieces are valued differently, and the AI evaluates multiple moves ahead, it will sacrifice a piece or bait you into a certain next move if it expects it to more probably lead to a better overall game state down the line. The decision heuristic follows the minimax method. In other words, it directs its knowledge search and makes decisions to minimize your possible gain, in the case of optimal play.

Gameplay demo

gameplay-gif

Installation

  1. Clone the project
  2. Install the necessary requirements using pip install -r requirements.txt. If tk fails (common on macOS), install it using brew: brew install python-tk.
  3. Run the start script play.py
  4. Play using the GUI!

How to play

You start as whites. Click on a piece and then click it's location. The game does support castling, and will prevent you from making any illegal moves.

About

A minimax based active information directed tree search model that plays chess ♟️

Topics

Resources

Stars

Watchers

Forks

Languages