PyChess – A chess program for your Rasp Pi

Espionage and Tips

In the View menu, you can check the Hint mode box to see tips for your next moves during the game. This box particularly benefits weaker players who want to improve their skills in the game. Spy mode, which is enabled in the same menu, shows you what the chess engine is "thinking about"; the moves appear directly on the board in the form of red arrows for your opponent's next moves (Figure 3).

Figure 3: The chessboard without additional displays and Spy mode turned on.

If you want to eliminate additional panels and only see the game board with the clock on the screen, uncheck the Show sidepanels box in the View menu. Although the sidebar goes away (Figure 3), PyChess continues to update the list displays in the background, and you can view them during the current match by checking Show sidepanels again.

To make sure you can quit a game or track a played game at a later date, PyChess lets you save the game. The Game | Save Game and Game | Save Game As options let you store the current game on your hard disk in the standardized PGN format. Most chess programs support this text-based format. Additionally, there is nothing to prevent you from exchanging data via the PGN format with chess databases such as Scidb. The Load Game and Load Recent Game options, also in the Game menu, let you reload the desired game at a later date.

Starting Positions

Chess puzzles that give you a specific starting position and task are a special attraction. Serious players are then expected to find the appropriate solution. For this purpose, PyChess offers a free position input mode that lets you set up a challenge in the chess program. To do so, go to the Game | Enter Game Notation menu and enter the notation on the right in the large input box in the dialog box that appears. On the left side of this window, you then define the players and set the time constraints and the variant (Figure 4).

Figure 4: Select your game settings, then press Start Game. Notice that this game is set up to play the PyChess engine against the stockfish engine.

PyChess gives you the option of letting the various chess engines battle it out. You can use sliders to adjust the computational depth, and thus the skill level of your chosen engines. After you press the Start Game button at the bottom right in the dialog box, the program moves the figures on the board in the main window to match the notation information. If you have defined human players, it is their turn. If you want the chess engines to handle the task, the game starts automatically.

Buy this article as PDF

Express-Checkout as PDF

Pages: 6

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Welcome

    We are living with an embarrassment of choice. Small-board computers (SBCs) are getting smaller and faster, with many inexpensive options for the hobbyist and problem-solvers and more powerful, usually pricier, options for inventors, innovators, and CPU-guzzling consumers. New SBCs are entering the market continuously, it seems.

  • Emulating game console classics on the Raspberry Pi

    The Raspberry Pi is particularly well suited for playing classic games, and a pair of promising Rasp Pi distros come preconfigured with several built-in game emulators.

  • Use Scratch's senses to design a game

    To create a game with action and consequences, you need a tool that can sense information in real time. We show how to do this using the Scratch programming environment.

  • Creating a high score leaderboard

    Learn how to save and track player high scores from one game to the next using lists and variables.

  • Synchronizing with broadcasts

    This article draws inspiration from the popular Pokémon Go app to recreate a sprite hunting game in Scratch. The project explores synchronization and randomness as the player explores various backdrops in search of sprites.