Customer:
April Kontostathis(apk5)
Analysts:
Shreeram Sahasrabudhe
(sas4)
Ted Mielczarek
(tam4)
Jeff Heigl
(jjh5)
Purpose: To develop a chess game to be played by two people on the same computer.
Scope: The game will require two people to play. The game will not be played over the network. The players will interact with the board through a GUI. The game will use all the rules of chess except the en passant rule.
Definitions:
Board: A 8 X 8 grid of alternating black and white squares.
Piece: The actual elements that are used to play the game. It is one of: pawn, queen, king, rook, knight and bishop. They are either white or black in color.
Team: A set of pieces of the same color belonging to a player. There are two teams in the game – white and black.
Pawn: There are eight pawns situated on each side of the board. Pawns cannot move backward or sideways, but must move straight ahead unless they are taking another piece. Generally pawns move only one square at a time. The exception is the first time a pawn is moved; it may move forward two squares as long as there are no obstructing pieces. A pawn cannot capture a piece directly in front of him but only one at a forward angle. Should a pawn get all the way across the board to reach the opponent's edge of the table, it will be promoted. The pawn may now become any piece that the moving player desires (except a king or pawn).
Queen: Each side has one queen initially. The queen can move as many squares as she desires and in any direction (barring any obstructions). She captures in the same way that she moves, replacing the unlucky opposing piece that got in her way. She must, of course, stop in the square of the piece she has captured.
King: Each side has one king. The king can only move one square in any direction. There is only one restriction on his movement - he may not move into a position where he may be captured by an opposing piece. The king is the most vital, for once he is lost the game is lost.
Rook: Each side has two rooks initially. The rook can move any number of squares in a straight line along any column or row. They CANNOT move diagonally. It captures in the same way that it moves, replacing the unlucky opposing piece that got in its way. It must, of course, stop in the square of the piece it has captured.
Knight: Each side has two rooks initially. The knight is the only piece on the board that may jump over other pieces. The knight can be thought of as moving one square along any rank or file and then at an angle, as defined in the diagram below. (The yellow dot is the square being passed over and the blue dot is the space where the knight may move and may also capture opposition pieces.) The knight's movement can also be viewed as an "L" laid out at any horizontal or vertical angle.
Bishop: Each side has two bishops initially. The bishop may move any number of squares in a diagonal direction until it is prevented from continuing by another piece.
Capture: An action in which one piece takes the place of an opposing piece thus removing it from the game (board).
Check: Situation where a player's king is threatened by an opposing piece.
Checkmate: Situation where the king is in check and cannot move to a square where he would not be in check.
Stalemate: Stalemate is considered a tie. A stalemate occurs when a player's only move is to place his own king in check, but it's current square is not threatened. Stalemate also results when the only two pieces on the board are Kings.
Castling: The king moves two squares toward the rook he intends to castle with (this may be either rook). The rook then moves to the square through which the king passed. The diagram below makes this clear.
The castling move has some fairly rigid caveats:
Reference:
The chess rules and diagrams were taken from
http://www.conservativebookstore.com/chess/castling.htm
Functional Specifications: The game starts with each player entering their names and the first player choosing a color. The second player, obviously, would be the other. The board is displayed next with the pieces arranged on it and the player names displayed on the appropriate side. The player with the white team makes the first move. The player take turns moving or capturing one piece at a time. The play continues until either a checkmate or stalemate is reached. The pieces captured during the game are removed from the board and put next to the board according to their team color.
At the end of the game, a new game may be started.
System constraints: It will be platform independent.
Personnel: Ted Mielczarek (Analyst), Shreeram Sahasrabudhe (Analyst) and Jeff Heigl (Analyst).
Use Case:
Input Player Names and Choose Color
Move Piece:
Alternative 2a: The destination square is not a valid move for the piece
3) A message is displayed indicating that it is not in valid moves for that piece.
4) Go to step 2.
Alternative 2b: The king goes into check on moving the selected piece.
3) A message is displayed telling the player that the move puts the king in check and hence he cannot make that move.
4) That piece is automatically deselected.
5) Go to step 1.
Alternative 2c: The destination is same as the current piece position.
3) The piece is deselected.
4) Go to step 1.
Alternative - 2d: The destination square is occupied by the opponent’s piece.
3) Check that move is a valid capture (this is a special case for pawn). If not go to step 2.
4) The player’s piece moves into the new square thus capturing the opponent’s piece.
5) The opponent’s piece is removed from the square and put on the opponent’s side with the rest of the captured pieces.
Alternative 2e: The destination square is occupied by the player’s piece.
3) A message is displayed indicating that the square is already occupied.
4) Go to step 2.
Alternative 2f: Path is blocked
3b) If square is empty, but path to square is blocked (and piece is not a Knight), piece stays in original spot.
3c) Notify user that the move is blocked, goto step 2.
2a. As a result of this move, the opposing player can now capture the king.
3. Move is disallowed, and player gets to choose their move again.
Alternative: Player puts themselves in check and opposing player in check.
2a. As a result of the move, the piece can capture the opposing player’s king on their next turn.
2b. Also the opposing player can now capture the king.
3. Move is disallowed, and player gets to choose their move again.
Alternative: Player puts opposing player in checkmate
3a. On opposing player’s turn, it is not possible to move the king to a square where it cannot be captured by the opposing team.
3b. Because the player will indefinitely lose their king on the next turn, the opposing player wins the game.
1. King is the only available piece to move.
2. King is not currently in check.
3. Moving the king would place him in check.
4. Game ends in a tie.
Castling:
Alternatives: Either the king or the rook has been moved at all
3a. Display message “cannot castle”.
Alternatives: The path between them is blocked
3a. Display message “cannot castle”.
Alternatives: If the king is in check.
3a. Display message “cannot castle”.
Alternatives: If the king can be attacked on any of the squares in the path
3a. Display message “cannot castle”.
Resign: