Skip to content

fsoonaye/chimp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

238 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

♟️🐒 Chimp

Chimp is a UCI-compatible chess engine following a depth-first search approach. It sits at ~2500 elo in its edge build.

Meaning, given a chess position (the root), it generates a move tree and explores as far as possible along each branch before backtracking. The engine searches for the best move to play amongst the root's children, using optimization techniques to efficiently prune branches that are unlikely to lead to favorable outcomes.

Features

Search

  • Negamax Search
  • Alpha-beta Pruning
  • Iterative Deepening
  • Move Ordering
    • Transposition Table
    • MVV-LVA for capture moves
    • Killers for quiet moves
  • Quiescence Search
  • Mate Distance Pruning
  • Principal Variation Search

Evaluation

  • Material Score
    • Piece-Square Tables
    • Bishop Pair Bonus
  • Mobility Score
  • Game Phase Interpolation

Building

Chimp requires the following tools to build and run:

  • Compiler: clang++.
  • Build System: make.

To build Chimp, you can run the following commands:

git clone https://github.com/fsoonaye/chimp.git
cd chimp
make
./engine

UCI Instructions

Chimp supports the following UCI (Universal Chess Interface) commands:

uci  
isready  
ucinewgame
quit  
stop  
  
position startpos
position fen <fen-string> moves <move1> <move2> ...    
go depth <>  
go nodes <>  
go perft <>  
go wtime <> btime <> winc <> binc <> movestogo <>
go movetime <>    
go mate <>
eval  

Further explanations of these commands can be found in uci.h and on the internet, for instance here or in the official stockfish documentation.

History

This chess engine is the culmination of my ongoing exploration into the rich and complex niche that is chess programming.

In its current state, Chimp has, for now, absolutely no pretentions of revolutionizing the field of chess programming. Instead, its purpose is to serve as a personal milestone: a proof of my journey and dedication to grasp the fundamentals of this fascinating domain.

I have only implemented techniques and concepts that I believe to understand, one at a time, prioritizing clarity and simplicity. In many ways, this repository embodies the kind of resource I wish I'd had as an entry point.

This project also served as a playground for improving my C++ skills and documenting what I learned. Over time, I’ve built a significant collection of notes. One day, I might turn these notes into a guide to chess programming.

One thing I definitely plan to write soon is a comprehensive guide to chess engine testing. Having all this information gathered in one place and thoroughly explained would have saved me so much time!

Resources

While the guides I plan to write are still in progress, here’s a list of useful resources I’ve used or depended on to deepen my knowledge.

Useful Tools:

Wikis:

Acknowledgements and Credit

I have annotated concepts and arrays in my source code to properly credit the sources where I’ve borrowed ideas or implementations directly from other engines. However, if I’ve missed an attribution, I encourage the authors of these works to reach out for additional recognition or to request removal, if necessary.

Engines that have been notable sources of inspiration:

Special thanks to:

About

Chimp is a UCI-compatible chess engine developed in C++ with a depth-first search approach.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages