Charly's Column – Stockfish
Charly's Column – Stockfish
In the absence of an IBM supercomputer at his data center in Germany's Lower Rhine region, Charly has to make do with a Linux desktop, Stockfish, and chs in order to follow in the footsteps of chess grandmaster Garry Kasparov.
Writer Raymond Chandler called chess "as elaborate a waste of human intelligence as you can find outside an advertising agency." But that doesn't put us off, does it?
In 1996, the media frenzy was huge when the Deep Blue chess computer developed by IBM beat the reigning world champion Garry Kasparov [1]. However, Deep Blue was also a veritable wall cabinet with power consumption to match. Today there are powerful open source chess engines for the home Linux desktop. One of the most powerful engines goes by the name of Stockfish [2]. It has been in development for more than 10 years and has now reached version 12.
However, Stockfish only provides the artificial chess intelligence. You also need a user interface (i.e., a game board). As a chess aficionado, I decided to use chs, which is written in Python. Chs lets you play against the Stockfish engine in your terminal. First, you need to install Stockfish and the Python installer pip before calling pip
to install chs (Listing 1).
Listing 1
Installing chs
$ sudo apt install stockfish python3-pip $ pip install chs
Then you need to tell chs where to find the Stockfish engine. This involves editing the .local/lib/python3.6/site-packages/chs/engine/stockfish.py
file. The line starting with engine_path
needs to be edited as shown in Listing 2.
Listing 2
Editing stockfish.py
[...] elif 'Linux' in platform.system(): engine_path = '/usr/games/stockfish' [...]
All done. I can now type chs
to start a game. You enter the moves in a line of text. The letter indicates which figure you want to move:
- N = Knight
- R = Rook
- Q = Queen
- K = King
- B = Bishop
By the way, the word rook originally comes from Persian, where "rukh" means a chariot. There is no letter for the pawn, which is not necessary due to the limited move paths. To move the left white pawn two squares forward, simply enter a4
. For the other chess pieces, you enter the name and the target square. "Rook to c6" is therefore Rc6
.
Chs logs the moves in Portable Game Notation (PGN) [3], which is shown in Figure 1 to the right of the chessboard. Bxc6
means that the white bishop has been moved to c6; the x
indicates that it has taken an opponent's piece.
Chs doesn't have a stop clock, but no worries. The way I play follows a saying by the German writer Otto Galo. In comparing politics to chess, Galo said it's hard to make the best moves under pressure.
Infos
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Rhino Linux Announces Latest "Quick Update"
If you prefer your Linux distribution to be of the rolling type, Rhino Linux delivers a beautiful and reliable experience.
-
Plasma Desktop Will Soon Ask for Donations
The next iteration of Plasma has reached the soft feature freeze for the 6.2 version and includes a feature that could be divisive.
-
Linux Market Share Hits New High
For the first time, the Linux market share has reached a new high for desktops, and the trend looks like it will continue.
-
LibreOffice 24.8 Delivers New Features
LibreOffice is often considered the de facto standard office suite for the Linux operating system.
-
Deepin 23 Offers Wayland Support and New AI Tool
Deepin has been considered one of the most beautiful desktop operating systems for a long time and the arrival of version 23 has bolstered that reputation.
-
CachyOS Adds Support for System76's COSMIC Desktop
The August 2024 release of CachyOS includes support for the COSMIC desktop as well as some important bits for video.
-
Linux Foundation Adopts OMI to Foster Ethical LLMs
The Open Model Initiative hopes to create community LLMs that rival proprietary models but avoid restrictive licensing that limits usage.
-
Ubuntu 24.10 to Include the Latest Linux Kernel
Ubuntu users have grown accustomed to their favorite distribution shipping with a kernel that's not quite as up-to-date as other distros but that changes with 24.10.
-
Plasma Desktop 6.1.4 Release Includes Improvements and Bug Fixes
The latest release from the KDE team improves the KWin window and composite managers and plenty of fixes.
-
Manjaro Team Tests Immutable Version of its Arch-Based Distribution
If you're a fan of immutable operating systems, you'll be thrilled to know that the Manjaro team is working on an immutable spin that is now available for testing.