Download Four Knights Chess Program: Requirements and Functional Specifications and more Lab Reports Software Engineering in PDF only on Docsity!
Four Knights Program Requirements
Alfred Blackman
Hung Dinh
Julian Lico
Ray Ross
February 12, 2009
Chapter 1
Introduction
1.1 Product Overview
The software will be a computer based chess game. It will adhere to the USCF rules of chess using a graphical interface. The game is to be entirely network based, and will require users to login to gain access. The game will contain standard features such as logging moves, resigning from games, and showing taken pieces, while additonally supporting modern features such as saving games and network play.
1.2 Scope
This document is intended to detail software features required for the chess program. This document gives explicit instruction for the rules of chess as they are to be implemented. It also lists several features which are required in the final product.
1.3 Purpose
This document is inteneded to focus on all elements of the chess program for its expected delivery at the end of the quarter. It will focus on three sections, (1) chess rules, (2) functional and non-functional requirements of software, (3) expected use Specifically, This document will describe a detailed explanation of the chess game and rules. Any ambiguity in play and rules will be addressed. Key features will be described in full detail. Novel features that may be consid- ered as extras will be included to provide a complete picture. This document does not give explicit instruction on how to implement the game of chess. The intended audience of this document will include developers, testers, and the customers of this program.
Chapter 2
Specific Requirements
2.1 Non-Functional Requirements
- 100 The program shall use mouse and keyboard for input.
- 110 The program shall run in Java Virtual Machine.
- 120 The program shall not take more than 3 seconds to determine if the game has ended at the beginning of a turn.
- 130 The program shall not impose a limit on the maximum amount of moves a game may take.
2.2 Functional Requirements
2.2.1 Board and Piece Setup
- 140 The board shall be 8 by 8 composed of alternating dark and light squares in a checkered pattern.
- 150 Each piece shall have a unique graphic for both black and white players respectively.
- 160 A piece shall only cover 1 square at a time.
- 170 The square in the lower right corner is to be light.
- 180 The 8 vertical files (columns) shall be labeled alphabetically A - H from left to right.
- 190 The 8 horizontal ranks shall be labeled numerically (1 - 8) from bottom to top.
- 200 Each square on the board may be uniquely identified by its rank and file title (i.e. E4, H8).
- 210 White pawns shall be placed on all squares in rank 2
- 220 Black pawns are to be placed on all squares in rank 7
- 230 White pieces are to be placed on rank 1 as follows
- 240 Rooks on A and H
- 250 Knights on B and G
- 260 Bishops on C and F
- 270 Queen on E
- 280 King on D
- 290 Black pieces are to be placed on rank 8 as in the same fashion.
2.2.2 Movement
General Movement
- 300 A player may not move a piece onto a square that contains a piece they own.
- 310 A player may capture a piece their opponent controls by moving on to its square.
- 320 Captured pieces are removed from the board.
- 330 A player may not make a move that results in an opponent piece being able to capture their King.
- 340 No piece, excluding the knight, may move through occupied spaces.
- 350 No piece my move off of the board.
Movement by Piece
- 360 King: May move exactly one square in any direction.
- 370 Rook: May move any number of square along rank or file traveling straight only.
- 380 Bishop: May move diagnally any number of squares.
- 390 Queen: May move move either as a bishop or rook.
- 400 Knight: May move in exactly 2 squares horizontally and 1 vertically or vice versa.
- 410 Pawn:
- 420 May only move exactly 1 square forward (toward the opponent’s edge of the board)
Draw Conditions
- 650 If 50 turns have passed without a capture, the game is a draw.
- 660 If at the beginning of a player’s turn they are not in check and cannot make a legal move the game is a draw.
- 670 Players shall be able to mutually choose to end the game as a draw at any time during gameplay.
Win/Lose Conditions
- 680 If a player is in check and cannot make a legal move they lose.
- 690 A player may choose to resign and concede victory to their opponent at any time during gameplay.
- 700 In a timed game only: if a player’s time reaches zero that player loses.
2.2.4 Saving and Loading
- 710 At any time a local player shall be able to save the game.
- 720 Prior to gameplay the players may agree to load a saved game.
- 730 A loaded game is to begin at the state which the game from which it was saved ended.
- 740 Networked saved games may only be played against the original op- ponent.
Chapter 3
Use Cases
3.1 Accounts
3.1.1 Logging In
The user shall run the program and be greeted with the following options for logging in:
- Enter their Username and Password
- Logon as a guest
- Register an account
The scenarios will correspond with the following actions
- Correct username and password: Taken to server with credentials
- Incorrect username and password: Log-in screen persists with text that alerts user that username and password is incorrect.
- Guest button is pressed: Taken to server with guest credentials
- Register button is pressed: See Registration scenario.
3.1.2 Registration
The user is presented with a form that allows user to fill in username and password. If username is unique and password matches, an account will be created. User will be taken to server with these credentials.
3.3 During Chess Game
3.3.1 Take Turn
Once it is the users turn, the user can move the chess piece to a valid square on the board. User takes turn until an end condition is reached as specified in the rules.
3.3.2 Resign
At any point in the game, the user may press the resign button to forfeit the game. When the resign button is pressed, the game engine will prompt the user for confirmation. If user confirms, the game is forfeited and the opponent is declared the winner.
3.3.3 Request Draw
At any point in the game, the user may press the draw button to ask the opponent whether they also want to declare the game as a draw. If draw is not accepted by opponent, game is continued. If draw is accepted, game is declared
a draw.