# &app; Manual V&manrevision;

User manual for the glChess, a 2D/3D chess game for GNOME.

2006
Andreas Røsdal
GNOME Documentation Project

&legal;

Andreas
Røsdal

     andrearo@pvv.ntnu.no

&appname; Manual V&manrevision;
&date;

Andreas Røsdal andrearo@pvv.ntnu.no

GNOME Documentation Project

1
December 2006
AR
First draft completed.
This manual describes version &appversion; of &appname;.

## Feedback

To report a bug or make a suggestion regarding the &app; application or this manual, follow the directions in the GNOME Feedback Page.

## Introduction

### Overview of Chess

Chess is a two-player strategy board game. glChess is a 2D/3D chess game, where games can be played between a combination of human and computer players. glChess detects known third party chess engines for computer players. The game was originally developed by Robert Ancell, now the game is included in gnome-games.

glChess is written in Python and uses GTK+ and Cairo to render the chess board. 3D support is optionally available using OpenGl, using the Python OpenGL and GtkGLExt libraries. As with most modern 3D programs hardware acceleration is recommended but it should run OK in software. glChess is bundled with GNU Chess as the default chess AI.

Chess is played on a square chessboard, consisting of 64 squares of alternating color. Each player begins the game with sixteen pieces: one king, one queen, two rooks, two knights, two bishops, and eight pawns. One player controls the white pieces and the other player controls the black pieces; the player that controls white is the first to move. The players take turns moving pieces; certain moves involve a "capturing" of an opponent's piece, removing it from the chessboard. The object of the game is to checkmate the opponent's king. This occurs when the king is under immediate attack (in check) and there is no way to remove it from attack on the next move. Theoreticians have developed extensive chess strategies and tactics since the game's inception.

The current form of the game emerged in South Europe in the second half of the 15th century after evolving from similar, much older games of Asian origin. Chess is one of the world's most popular board games. The tradition of competitive chess began in the 16th century. The first official World Chess Champion, Wilhelm Steinitz, claimed his title in 1886; his modern equivalent, Vladimir Kramnik, is the 14th Champion in the lineage. There are also biennial world team events called Chess Olympiads. Since the 20th century, two international organizations, the World Chess Federation and the International Correspondence Chess Federation have organized and overseen the top chess competitions and international titles.

One of the goals of early computer scientists was to create a chess-playing machine, and today's chess is deeply influenced by the overwhelming abilities of current chess programs. In 1997, a match between Garry Kasparov, then World Champion, and IBM's Deep Blue chess program proved that computers are able to beat even the strongest human players.

To run glChess, select Chess from the Games submenu of the Main Menu, or type `glchess` on the command line.

## Chess Rules

### The Rules of Chess

Chess is played on a square board of eight rows (called ranks and denoted with numbers 1 to 8) and eight columns (called files and denoted with letters a to h) of squares. The colors of the sixty-four squares alternate between light and dark, and are referred to as "light squares" and "dark squares". The chessboard is placed so that each player has a white square in the near right hand corner, and the pieces are set out as shown in the diagram, with each queen on a square that matches its color.

Each player begins the game with sixteen pieces: each player's pieces comprise one king, one queen, two rooks, two bishops, two knights and eight pawns. One player, referred to as White, controls the white pieces and the other player, Black, controls the black pieces; White is always the first player to move. The colors are chosen either by a friendly agreement, by a game of chance or by a tournament director. The players alternate moving one piece at a time (with the exception of castling, when two pieces are moved at the same time). Pieces are moved to either an unoccupied square, or one occupied by an opponent's piece, capturing it and removing it from play. With one exception (en passant), all pieces capture opponent's pieces by moving to the square that the opponent's piece occupies.

#### King

When a king is under direct attack by one (or possibly two) of the opponent's pieces, the player is said to be in check. When in check, only moves that remove the king from attack are permitted. The player must not make any move that would place his king in check. The object of the game is to checkmate the opponent; this occurs when the opponent's king is in check, and there are no moves that remove the king from attack.

The king can move only one square horizontally, vertically, or diagonally. Once in the game, each king is allowed to make a special double move, to castle. Castling consists of moving the king two squares towards a rook, then moving the rook onto the square over which the king crossed. Castling is only permissible if all of the following conditions hold:

- The player must never have moved both the king and the rook involved in castling.

- There must be no pieces between the king and the rook.

- The king may not currently be in check, nor may the king pass through squares that are under attack by enemy pieces. As with any move, castling is illegal if it would place the king in check.

- The king and the rook must be on the same rank (to exclude castling with a promoted pawn).

#### Rook

The rook moves any number of vacant squares vertically or horizontally (it is also involved in the king's special move of castling).

#### Bishop

The bishop moves any number of vacant squares in any direction diagonally. Note that a bishop never changes square color, therefore players speak about "light-squared" or "dark-squared" bishops.

#### Queen

The queen can move any number of vacant squares diagonally, horizontally, or vertically.

#### Knight

The knight can jump over occupied squares and moves two spaces horizontally and one space vertically or vice versa, making an "L" shape. A knight in the middle of the board has eight squares to which it can move. Note that every time a knight moves, it changes square color.

#### Pawns

Pawns have the most complex rules of movement: A pawn can move forward one square, if that square is unoccupied. If it has not moved yet, the pawn has the option of moving two squares forward, if both squares in front of the pawn are unoccupied. A pawn cannot move backward. When such an initial two square advance is made that puts that pawn horizontally adjacent to an opponent's pawn, the opponent's pawn can capture that pawn "en passant" as if it moved forward only one square rather than two, but only on the immediately subsequent move. Pawns are the only pieces that capture differently than they move. They can capture an enemy piece on either of the two spaces adjacent to the space in front of them (i.e., the two squares diagonally in front of them), but cannot move to these spaces if they are vacant. If a pawn advances all the way to its eighth rank, it is then promoted (converted) to a queen, rook, bishop, or knight of the same color. In practice, the pawn is almost always promoted to a queen.

#### Remaining movement rules

With the exception of the knight, pieces cannot jump over each other. One's own pieces ("friendly pieces") cannot be passed if they are in the line of movement, and a friendly piece can never replace another friendly piece. Enemy pieces cannot be passed, but they can be "captured". When a piece is captured (or taken), the attacking piece replaces the enemy piece on its square (en passant being the only exception). The captured piece is thus removed from the game and may not be returned to play for the remainder of the game. The king cannot be captured, only put in check. If a player is unable to get the king out of check, checkmate results, with the loss of the game.

Chess games do not have to end in checkmate — either player may resign if the situation looks hopeless. Games also may end in a draw (tie). A draw can occur in several situations, including draw by agreement, stalemate, threefold repetition of a position, the fifty move rule, or a draw by impossibility of checkmate (usually because of insufficient material to checkmate).

## Chess Engines

glChess should be able to use any Chess Engine Communication Protocol or Universal Chess Interface compatible chess engines, including these chess engines:

- GNUChess

- Sjeng

- Amy

- Crafty

- Faile

- Phalanx

- Glaurung

- HoiChess

- Diablo

- BBChess

- Fruit

- Amundsen

## Known Bugs and Limitations

- There are no documented bugs or limitations in glChess.

## Authors

glChess was written by Robert Ancell, and is now maintained in gnome-games. To report a bug or make a suggestion regarding this application or this manual, follow the directions in this document.

## License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

A copy of the GNU General Public License is included as an appendix to the GNOME Users Guide. You may also obtain a copy of the GNU General Public License from the Free Software Foundation by visiting their Web site or by writing to

        Free Software Foundation, Inc.
        59 Temple Place - Suite 330
        Boston, MA 02111-1307
        USA