Description
Sunfish is a simple open-source chess engine written in Python by Thomas Dybdahl Ahle, for teaching purposes. It is released under the GPL. Without the piece-square table data and its simple command-line interface, the engine takes up about 111 lines of code. The engine uses MTD-bi, a binary-search form of MTD(f), inside an iterative deepening search. The evaluation counts piece values and piece-square tables, and the score is updated incrementally when a move is made. It has a command-line interface with a Unicode board, and it speaks the Chess Engine Communication Protocol, so it can play through graphical front ends such as XBoard or PyChess. The name follows the pygmy sunfish, one of the few fish whose name starts with Py. The Chess Programming Wiki page lists its publications, forum postings and the source repository on GitHub. Sunfish is a good starting point for someone who wants to read a small, complete chess engine.…
Highlights
- Chess engine in about 111 lines of Python
- MTD-bi search with iterative deepening
- Unicode command-line board
- Chess Engine Communication Protocol support
- GPL license
Ratings & Reviews
No ratings yet
Be the first to rate Sunfish.
People also visit
Stockfish.js
The strong open source chess engine Stockfish compiled to JavaScript
Sunfish FAQ
What is Sunfish?
A small chess engine written in Python for teaching, in about 111 lines of code.
Can it play with a graphical board?
Yes. It supports the Chess Engine Communication Protocol, so front ends such as XBoard and PyChess can use it.
What is its search method?
MTD-bi inside an iterative deepening framework, according to the Chess Programming Wiki page.
Is it free?
Yes. It is released under the GPL and the source is on GitHub.
Where can I read more?
The Chess Programming Wiki page lists its publications and forum posts.
What are the best Sunfish alternatives?
Popular alternatives to Sunfish include Command Line Chess, Reckless and DecodeChess. See all Sunfish alternatives

