Chess Opponent

There’s something about playing chess on a physical board that makes for a better game. With that in mind, I poked around a bit trying to find a chess program for use in playing on a physical board that, at a minimum, communicated it’s moves using chess notation and had no distracting onscreen board. They probably exist, but I didn’t run across one in short order. So I turned my attention to the possibility of modifying GNU Chess to serve the purpose.

Aside from being used as an engine with applications like Xboard that provide a GUI onscreen board, I knew that GNU Chess could be run alone in a terminal where its output is text-only. In that case, the program conveniently displays the computer’s moves in standard algebraic notation (SAN) and accepts user moves as input of either SAN or coordinate notation. It also has the drawback of automatically displaying a text representation of the current board after each move while providing no means to disable that display. It seemed it would be simple to provide GNU Chess with such a means.

It turned out to be more complicated than expected. The convoluted (at least to me) nature of the program’s code, an apparent consequence of many changes by multiple people dating back to the 1990s, frustrated determination of where to make changes and what changes needed to be made.

While wading through the code, other improvements came to mind, and I finally decided to fork GNU Chess rather than just doing a patch or two. The fork needed a name, so I went with what it was intended to be: a “Chess Opponent.”

What’s been accomplished so far:

  • Eliminated default automatic board display.
  • Added in-game commands to display the board from either black or white perspective to facilitate checking for suspected human errors in physical board piece positioning. Because we’re all bound to make some.
  • Created a logo for use as an icon or whatever (shown above).
  • Added user selection query of side (i.e. black or white) before each new game.

What’s currently in the works:

  • Selective throttling control CPU core usage while “thinking” during the user’s turn to thereby enable reducing power consumption. As with GNU Chess, usage of a CPU core for such activity is currently either 100% or 0%.

Functionality on the drawing board:

  • Command, help, and usability improvements.
  • Modifications to the selection query at the start of each new game, including:
    • addition of a random option.
    • addition of default selections, including:
      • random for first new game since program start.
      • the color opposite that just played for second and subsequent games.
  • Option to display move output in coordinate rather than standard algebraic notation.
    • An in-game command for switching between notations.
  • Optional voice output to enhance play and facilitate use by people with visual impairments.
    • Functionality for easily navigating and reading out particular positions on the board to facilitate error correction by people with visual impairments. Being human, they’re bound to err, too.
  • Optional move output using cowsay, just for fun.

If you’d like to try it out or fork it yourself, the source code and latest release of Chess Opponent are available in my chessopp repository on GitHub.