Skip to content

ahmadfantastic/chess_checkmate_puzzle_solver

Repository files navigation

Chess Checkmate Puzzle Solver

This program uses simple AI search techniques to solve chess checkmate puzzles.

Techniques used include

  • MiniMax Algorithm
  • Alpha-Beta Pruning
  • Transposition
  • Killer Move Heuristic (for Move Ordering)

About the Project

This project was completed as a course project on Artificial Intelligence at Clarkson University taught by Prof. Christopher Lynch.

Project Completed by:

Project Documents

Running

Prerequisite

The prerequisites needed to run this program are

Installation

  1. The only package needed to install this program is python-chess. To install it, run the command pip install chess
  2. Clone this reposition using: git clone https://github.com/ahmadfantastic/chess_checkmate_puzzle_solver.git
  3. Open the project using your IDE.

Available Puzzle Problems

There are some chess checkmate puzzles in the /puzzles folder, with even more in the /puzzles_full folder. These puzzles are fetched from: https://wtharvey.com/.

Running an Example

Here is a sample code snippet to run the checkmate in 2 puzzles in /puzzles

if __name__ == '__main__':
    puzzles = puzzleloader.load_puzzle_file('puzzles/mate2.txt')

    for i in range(len(puzzles)):
        print("Test Case ", i + 1)
        puzzle = puzzles[i]
        state = State(puzzle['player'], puzzle['position'], puzzle['mate'])
        start_problem(state, puzzle['solution'], SearchAlgorithm.TRANSPOSITION)

Releases

No releases published

Packages

No packages published

Languages