sunfish is a minimalist yet surprisingly strong chess engine written in Python, designed to demonstrate how powerful algorithms can be implemented in a highly compact codebase. Despite being only around a hundred lines of core logic, the engine achieves competitive performance, reaching ratings above 2000 on online platforms. It implements classic chess engine techniques such as alpha-beta pruning and efficient board representation while maintaining readability and simplicity. The project is often used as an educational tool for understanding game AI, search algorithms, and evaluation functions without the complexity of larger engines. It includes a simple UCI-compatible interface, allowing it to be integrated with graphical chess interfaces or used in terminal-based gameplay. The codebase is intentionally minimal, making it ideal for experimentation, modification, and learning purposes.
Features
- Compact chess engine implemented in a very small codebase
- Competitive playing strength despite minimal implementation
- Uses alpha-beta pruning and efficient search algorithms
- UCI-compatible interface for integration with chess GUIs
- Suitable for experimentation and educational purposes
- Includes terminal-based gameplay interface