Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

CSCI 1933 Chess Rules Guide

For the following piece sections we will be using the notation (row, column) instead of

(x-pos, y-pos) because it reflects the convention that a 2D array is referenced as arr[row][column].

Note: In the Board .java class, you will be implementing several helper functions that ac- count for common ways that pieces can move.  These helper functions should be called in many of the piece classes in the isMoveLegal function.

1 Starting Position

The starting position of the game should look like the following diagram.  The movement of each piece will be described in further detail later in this writeup.

Remember that the provided Fen class will be useful for setting up the board to a specific state.

2 Pawn

The Pawn is the most simple piece on the board.  It can move only one position at a time, and only forwards vertically or diagonally.  If it is making its very first move, however, it may move two positions straight forward.  This makes it a less useful piece than the other listed below, but it has one ace up its sleeve. If a player’s pawn reaches the opposite end of the board before being captured, then it is promoted. In this situation, the pawn can be turned into any other piece aside from a king.  This makes it quite a powerful piece...  if you can cross the entire board one square at a time that is.  While we have given you a filled out Pawn.java class, you must implement pawn promotion yourself.

Hint: Pawn promotion will be most easily implemented within Piece .java. Pawn promotion should occur when a player’s pawn reaches the first or last “row”of the 2D Array, when this happens, you will prompt the player using Scanner to enter the name of the piece they want to promote it to besides the king.

3 Rook

The Rook is one of the most powerful pieces in the game, with the ability to move both horizontally and vertically, provided that no other pieces (of either color) are obstructing its path.

Below are some examples of the rook’s movement. Note that the rook is on location (2, 3).

Not pictured in the diagram is that it would be legal for the rook to “capture”the black pawn on location (4, 3), but it would not be legal for the rook to move to the white pawn at location (2, 6).

4 Bishop

The Bishop is another powerful piece, as it can move any distance. However, this piece moves only diagonally. Like the rook, it can only move provided its path is not blocked by another piece.

Below are some examples of the bishop’s movement. Note that the bishop is on location (2, 3).

Not pictured in the diagram is that it would be legal for the bishop to “capture” the black pawn on location (4, 5), but it would not be legal for the bishop to move to the white pawn at location (4, 1).

5 Knight

The Knight is a bit of a wildcard compared to the other pieces in chess.  All of the other pieces move linearly, but the knight moves in what is often referred to as an“L”shape. This means that it moves 2 squares out (either horizontally or vertically) from its place, and then 1 additional square out perpendicular to the direction of the first movement. The knight is also the only piece which can skip over another piece.  This means it may move to a new position even if there is another piece blocking the direct path.

Below are some examples of the knight’s movement. Note that the knight is on location (2, 3).

Not pictured in the diagram is that it would be legal for the knight to “capture” any piece of the opponent’s color iff it is in the position the knight is moving to.  The knight may not move to a position which has a friendly piece.

6 Queen

The Queen is the most powerful piece on the board, as it can move any distance in any direction. Unlike the knight, it can only move provided its path is not blocked by another piece.

Below are some examples of the queen’s movement. Note that the queen is on location (2, 3).

Not pictured in the diagram is that it would be legal for the queen to capture”the black pawns at locations (1, 3) & (4, 3), but it would not be legal for the queen to move to the white pawns at locations (2, 6) & (4, 1).

7 King

The King is not a particularly powerful piece, but is arguably the most important. Like the queen, it may move in any direction. Unlike the queen, it may only move one position away from where it stands.  This is the only requirement we are enforcing for the king’s movement.  However, if a

player’s king is captured” they lose the game. You must also implement this feature. Below are some examples of the king’s movement. Note that the king is on location (2, 3).

Not pictured in the diagram is that it would be legal for the king to “capture” the black pawns at locations (1, 3) & (2, 2) & (3, 4), but it would not be legal for the king to move to the white pawn at location (1, 2).