March 22, 2007

Chess engines for Linux

Author: M. Shuaib Khan

Chess engines for Linux are comparable in strength to commercial chess engines available for other platforms. Here's a look at the features of half a dozen of the most well-known chess engines for Linux.

A chess engine is the actual program against which you play the game. A chess engine can take a move as an input, and after analysis, generate a move of its own as an output.

To play against such an engine, you need a user interface. Most chess engines provide a command-line user interface, but that can be quite awkward. To make things easier, you can use a complete graphical user interface to communicate with the engine. XBoard and UCI (Universal Chess Interface) are two of the most popular and widely used free, open source communication protocols that enable a chess engine to communicate with a graphical user interface. Isolating the chess engine from its GUI gives you the choice of using any interface of your preference. You can easily make two chess engines, each of which supports these protocols, play against each other by making them communicate through an XBoard or UCI interface.


Crafty, developed by Robert Hyatt, is a descendant of the Cray Blitz chess engine that was the World Computer Chess Champion from 1983 to 1989. Its current peak ratings at the Internet Chess Club (ICC) stands at 3,286 (bullet), 3,388 (blitz) and 2,792 (standard). In the Swedish Chess Computer Association's (SSDF) current rating list, Crafty is at 36th position with an Elo rating of 2,616. In the 2004 World Computer Chess Championships, Crafty won the fourth place with same amounts of points as the third place finisher, Fritz 8.

Chess engine ratings

Chess engines' ratings aren't evaluated by comparing them against human players because chess engines do not participate regularly in human chess competitions. That's why such engines do not have official ratings from FIDE, USCF, or other chess organizations. Most of the engines are rated by making them play against other computers, and thus any rating given to a chess engine doesn't quite compare to a rating given to a human player. The skills required to play against other computer programs are different than those for playing against a human player. Chess engines are strong tactically but weak strategically, and are much better at blitz chess than at slow chess.

Crafty uses the XBoard protocol, and thus you need an XBoard compatible graphical interface to play against Crafty.

You can download both binary files and source code from Crafty's FTP site. Read the file in the FTP directory to learn about the files and folders present in the main directory. Opening books and endgame databases, which add to the strength of the engine, are available on the FTP site.

After installing Crafty, your can use it by specifying its location to XBoard with the -fcp parameter:

xboard -fcp "./crafty" -fd crafty_directory

Here crafty_directory is the directory where you installed Crafty.

Crafty is written in ANSI C and runs on Unix, Linux, DOS, Windows, OS/2, and Mac OS. Its strength depends on the processing speed of the machine it is used on, and the size of opening book and endgame databases you use. Even with minimal resources, Crafty can still provide quite a challenge. If you want to make it weaker so you can beat it, try the following options when loading it from the command line:

book off -- This options disables the use of opening book for crafty.

ponder off - Crafty can't think while you are playing your move.

st 1 -- Make the maximum thinking time for Crafty just one second.

sd n -- Crafty won't think more than n moves ahead.

If you are able to beat crafty too often, you can also make it more stronger with these options:

hash nK -- Makes the hash table bigger

hashp n -- Makes the hash table for pawns as large as possible

GNU Chess

GNU Chess is a free chess-playing program developed as part of the GNU project of the Free Software Foundation. It has been around for a long time and comes bundled in Linux distributions such as Slackware and Red Hat. The most recent version, GNU Chess 5, was rewritten from scratch in order to eliminate spaghetti code and replace antiquated data structures with more advanced computer chess implementation techniques. It uses opening books that are generated by studying games of masters. You can create your own opening books by listing all the games you want to include in the book in a PGN file, and using the command book add bookfile.png while running gnuchess from the command line. You can download an officially released PGN file to use to build the opening book from.

On the Internet Chess Club, a copy of GNU Chess running on an SGI Onyx R4400 under the handle MaxII achieved a blitz rating of over 2,500 and a standard rating of over 2,300.

There is a excellent Web-based version of GNU Chess that you can use to play against using a Web browser.


Phalanx chess engine was created by a young Czech student, Dusan Dobes, but he stopped working on it around the year 2000. His code is available under the GPL, and some members of the community are still working on it. It is weaker than either Crafty or GNU Chess, but still strong enough to beat an average player. Like Crafty it is XBoard compatible; to run it with XBoard, type xboard -fcp phalanx.

To change Phalanx's strength, use the following options:

-e level -- this can vary from 0 to 100, with 0 being the toughest level

-b [+/-] -- turns opening book on and off

-f [search time in seconds] -- time Phalanx takes to search for a move

For a complete list command-line options, see the README file that comes along with the source.


Sjeng was written by Gian-Carlo Pascutto with help from a few other colleagues. Deep Sjeng is a professional chess-playing and analysis program, complete with interface, opening book, chess server access, personalities, and multiprocessor and Universal Chess Interface (UCI) support. Its playing strength is over 2,750 Elo on fast hardware. In addition to standard chess, it can play other forms of chess, such as bughouse, crazyhouse, suicide. Like Crafty, Sjeng is XBoard-compatible. Sjeng is rated 2,674 in SSDF's current rating list.


Faile is an expert to master-strength chess program, depending upon the machine you run it on. It has a rating of 2,050 - 2,250 Elo. Faile's default book is based upon a collection of grandmaster games, designed to cover all Encyclopedia of Chess Openings lines. Faile's source code is small, but it is full-featured, and the code is well documented and thus can be helpful to those learning how to create their own chess engines.

Faile can be made to play stronger by increasing the amount of memory that it will use for its hash table:

faile -hash [size in MB]

Faile comes with a default opening book, but you can also make your own by making a Portable Game Notation (PGN) file of the games whose opening you wish Faile to use. After you have your desired PGN file, use Faile on it like this:

faile -mbook [PGN input file]


Fruit, developed by Fabien Letouzey, offers incredible playing strength. Fruit 2.2 finished second in the last World Computer Chess Championships in Reykjavik in 2005.

Though it hasn't got any outstanding strengths, Fruit hasn't got any weaknesses either. It plays a strong opening game, with excellent tactics in the middle game, and a superior endgame. It can figure out weak moves on an opponent's part with great accuracy, and take full advantage of them. It has beaten strong commercial chess engines such as Shredder and Junior.

Until version 2.1, Fruit was an open source engine, and the source code for version 2.1 is still available. But with Fruit becoming the strongest engine, the author decided to close the source code to avoid clones which might participate in official tournaments. Toga II and GambitFruit are two derivative works based on the code of version 2.1 of Fruit.


Linux users have a variety of chess engines to choose from, all having a unique playing strength and style of play. A complete list of chess engines is available at Timm Mann's engines page. These engines not only provide a challenging opponent to test your chess skills against, but also provide excellent learning tools to help you boost your chess play.