Back to Exhibition
Open Source
| C++ | university

Chess Engine

Advanced chess engine implementing minimax algorithm with alpha-beta pruning. Features move validation, AI opponent, and game state management.

A sophisticated chess engine implementing the minimax algorithm with alpha-beta pruning optimization. This project demonstrates deep understanding of game theory, tree search algorithms, and computational optimization.

The engine features a complete chess rule implementation, intelligent move ordering, and an evaluation function that considers piece values, positional advantages, and king safety. It can analyze positions up to 8 plies deep in reasonable time.

Tech Stack

C++ CMake SFML Google Test

Key Features

  • Complete chess rules including castling, en passant, and promotion
  • Minimax search with alpha-beta pruning
  • Move ordering heuristics for faster search
  • Positional evaluation considering piece-square tables
  • Three difficulty levels with adjustable search depth
  • Legal move highlighting and validation
  • Game state persistence and move history

Technical Highlights

  • Alpha-beta pruning reducing node evaluations by 90%+
  • Bitboard representation for efficient move generation
  • Transposition tables preventing redundant calculations
  • Quiescence search for tactical accuracy
  • Iterative deepening for time-controlled play
  • Principal Variation search optimization

Architecture

Board Representation

  • 64-bit bitboards for each piece type
  • Magic bitboards for sliding piece moves
  • Zobrist hashing for position identification
  • Incremental board state updates

Search Algorithm

  • Negamax with alpha-beta framework
  • Move ordering: captures, killers, history heuristic
  • Null move pruning for position refutation
  • Late move reduction for non-tactical moves

Challenges & Solutions

1

Implementing correct castling and en passant edge cases

2

Tuning evaluation function weights for balanced play

3

Debugging search algorithms with non-obvious bugs

4

Optimizing memory usage for deep search trees

Gallery

Chess Engine Screenshot 1