General

The chess web page is an online version of a chess­board and pieces. It has wide, but not complete, know­ledge of the rules of chess (see Limitations, below). It allows a player to move pieces around the board preventing illegal moves and kings from moving into check. Moves are logged in the side text box, the Move Log. It is single-player; it was developed as a tool for analyzing and playing out board positions.

The program runs in either of two modes: Play or Configure. Play mode is where a game is played. Configure mode is for configuring the board.

Features

Here is a list of the program’s features.

Limitations

The program has some limitations, probably more than are listed here. In Play mode:

Modes

The program runs in either of two modes: Play or Configure. It starts up in Play mode with pieces in their standard starting positions with white beginning play.

In Play mode, you play out a game. The program enforces that white and black take alternating turns and that the pieces can’t make illegal moves (with limitations).

In Configure mode you can clear the board, set it up for a new game with all pieces in standard starting position, or create a custom game by placing pieces anywhere on the board. You also specify which color starts in Play mode.

Message Box

Immediately above the chessboard is a message box. In Play mode, it tells the player whose turn it is—white’s or black’s. It also shows which rooks have castling rights: On the left side it shows white and black rooks that represent queen-side rooks; on the right side, the rooks represent king-side rooks. The rooks either are presented normally (♖♜), which means these rooks have castling rights, or with a circle and cross superimposed on them (♖⃠♜⃠), indicating that they do not.

In Configuration mode, the Message Box tells which color will be playing first when the mode is switched to Play. Also, for when adding pieces through the keyboard, it tells the color of the piece (see Keyboard Piece Placement).

Square Identification

Each square is identified by its file (a–h) and rank (1–8) as labeled to the left and bottom of the chess­board. Hovering the mouse over a square will display its identifier.

Move Log

The Move Log is the read-only text block to the right of the chess­board. In Play mode, as pieces are moved, the moves are logged there in long algebraic notation.* The moves are logged, including for castling, en passant, and pawn promotion. Moves that put the opposing king in check are annotated with “+”; en Passant moves are annotated with “e. p.”, and pawn promotions are annotated with “=” followed by the letter identifying the promotion piece, e.g., “=Q”.

* Wikipedia on long algebraic notation

There are three buttons are associated with the Move Log. They are situated directly below the log. They are described next.

Clear

The Move Log’s Clear button clears the Move Log. The log is also cleared when switching between Play and Configure modes.

Copy

The Move Log’s Copy button copies the contents of the Move Log to the system’s clipboard. From there it can be pasted into another document.

Checkmate

The Move Log’s Checkmate button annotates the last move in the log as a checkmate, replacing the check notation (“+”) with “#”. This can be useful, if saving the log, because the program does not itself detect checkmate.

General Buttons

The following buttons appear whether you are in Play or Configure modes.

Info

Clicking the Info button (ℹ️) opens this documentation.

Flip Board

The chess board is initially presented with the white pieces on the bottom and black at the top. The Flip Board button rotates the board 180° for the opposite presentation. The rank and file labels change to reflect the changed board position. The rank labels indicate the direction the pawns advance: white pawns toward rank 8; black pawns toward rank 1.

Save, Restore

When clicked, the Save button causes the program to remember the location of all the pieces and whose turn it is. The saved locations of the pieces and the current turn are restored when the Restore button is clicked. This can be useful when trying to analyze a certain situation, allowing the user to play out a certain scenario and then easily restore the pieces to play it out again. The Restore button is disabled until the board is saved. The Save button causes the program to remember the positions of the pieces and the current turn so that a board position may be played out and subsequently restored by pressing the Restore button. The Restore button is dimmed and disabled until a board has been saved. The positions are not remembered if the page is reloaded.

Reload Page

The Reload Page button is a convenience button that reloads the page from the current URL. It has the same functionality as manually reloading the page in the browser. The mode is set to Play.

Play Mode Buttons

The following buttons are only available in Play Mode.

Configure

The Play mode Configure button causes the program to switch to Configure mode. The Play-mode buttons are hidden, and the Configure-mode buttons are revealed.

Castle

The Play mode Castle button is used to effect a castling operation. The rook associated with castling is selected, then this button is clicked to execute the operation. Castling is only legal when certain conditions are met. This program validates some of those conditions.

Copy URL

When clicked, the Copy URL button records the state of the board, whose turn it is, and the board's orientation in a URL, which it copies to the system clipboard. This allows the user to save board position for a later time or to share with another user.

Configure Mode Buttons

The following buttons are only available in Configure Mode. They allow you to create custom situations for playing.

Play

The Configure mode Play causes the program to switch to Play mode. When pressed, the Configure-mode buttons are hidden, and the Play-mode buttons are revealed. This button is pressed when board configuration is complete and play is to commence.

Setup Board

The Configure mode Setup Board initializes the board with all pieces in their standard position to start a new game. It also clears the Move Log.

Clear Board

The Configure mode Clear Board button causes all pieces to be removed from the board. It also clears the Move Log.

Individual Piece Buttons

The individual piece buttons (, , , , , , , , , , , ) are available in Configure mode. They are used to place pieces on the board. After selecting the destination square, the desired piece button is clicked. The program then places the piece in the selected square, replacing any piece that may already be there, regardless of color. This operation is not considered a move, so it is not logged.

Delete Button

The Delete Button () is available in Configure mode. It is used to remove a piece from the board. The square in which the piece resides is first selected, then this button is clicked to remove the piece from the square. This is not considered a move, so it is not logged.

Flip Turn

The Configure mode Flip Turn button allows you to configure which side plays next in Play mode. The setting is displayed in the Message Box.

Operation

Normal Game

When the program opens, it is in Play mode (see Modes) and the chess pieces are placed in their standard starting positions with white’s pieces at the bottom of the board. The Message Box shows whose turn it is and castling rights.

Depending on circumstances, the player may make a Normal Move, Castle, en passant, or promote a pawn. These are described next.

Normal Move

The player moves pieces by first selecting the square of the piece to be moved and then the destination square. After selecting the piece to be moved, the program ensures that the selected piece corresponds to whose turn it is and that there are available spaces for it to move, and highlights those spaces, and waits for the destination square to be selected. When the destination square is selected, the move is completed, and the turn switches to the other player. If there are no available spaces, a message is displayed and the square is unselected.

If the piece is a king, however, the program ensures that the king is not moving into check and highlights in red those squares which would have the king in check. After the move, if the opposing king is now in check, the squares of the checking pieces are highlighted in green and the king in red.

After selecting a square to begin a move, to cancel the move, select that square a second time.

When the move is completed it is logged in the Move Log. If the move causes the opposing king to be in check, the king and attacking piece(s) are highlighted and the move is annotated with a plus sign (+) in the log. The program does not detect checkmate or stalemate.

Castling

Castling is effected with the Castle button. Following the rules of chess, the rook and king involved in the operation must be in their starting positions, the squares between them must be empty, and the king and participating rook must not have previously moved. The program does not enforce the rule that the king, his destination square, and the squares between them must not be under attack. The user selects the square that contains the rook associated with the operation, then clicks the Castle button. The operation is logged in the Move Log.

The status of the four rooks’ castling rights is given in the Message Box.

en passant

When conditions are right, en passant moves are recognized. The attacking and defending pawns must be in the proper rank and adjacent files. The attacking pawn is moved to the square behind the defending pawn, which must be empty. The defending pawn is removed, and the move logged with “e. p.” notation. The program does not enforce the rule that the en passant move must be made immediately after the opposing side moved the pawn or that that the opposing pawn made a two-square advance in the previous turn.

Pawn Promotion

When a pawn is advanced to its final rank through a move operation, whether perform­ing a capture or not, the player is prompted to specify the piece to which the pawn shall be promoted. The user must enter a single letter to identify the replacement piece: Q (queen), R (rook), N (knight), or B (bishop). The pawn is replaced with the requested piece and the move is logged in the Move Log.

Special Setups

To play from a non-standard setup, e.g., when trying to analyze a certain board position, you first put the program in Configure mode (see Modes) and then configure the board by placing the pieces where you want them. You enter Configure mode from Play mode by clicking the Configure button. Once in Configure Mode, the Clear Board button can be used to clear the board. Then individual pieces can be added, replaced, or removed from the board. The process is to select the square and then add or replace the piece on that square by clicking the desired piece’s individual piece button or delete the pieces with the button.

Alternatively, you can select squares and configure the board using the keyboard (see next section).

Keyboard Piece Placement

Once a square is selected, a specific piece can be entered by pressing that piece's designated letter on the keyboard: K for king, Q for queen, R for rook, B for bishop, N for knight, and P for pawn. To clear a square, press X or the Delete key. The color of the added piece is designated in the Message Box. To change the color of subsequently added pieces, press the Space bar. The arrow keys change which square is selected.


See with collapsible sections