Dots and Boxes

System Requirements Document (SRD)

 

 
 

Version 1.0

23 August 2001

 
Team Member
email
Role
Donna Stidolph
donna@stidolph.com
Only contributor

Configuration Change Record (CCR)

 
Date
Version
Changes/Additions
Resp. Person
8/23/ 2001
1.0
Initial release of SRD
D. Stidolph
Table of Contents

1 Product Overview.......................................................................................................................................................1

1.1 Description of the Product................................................................................................................................ 1
1.2Purpose of the Product........................................................................................................................................ 1
1.3  Problem Solved by the Product...................................................................................................................... 1
1.4Objectives of the Product................................................................................................................................... 1
1.5 Special Considerations........................................................................................................................................ 1
1.6 Benefit to Business...............................................................................................................................................2
1.7 Schedule and Finance Considerations....................................................................................................... 2
1.8 Expectations and Limitations of this Product.................................................................................. 2
1.9 Summary Description............................................................................................................................................ 2
1.10 Acceptance criteria.......................................................................................................................................... 2

2 Applicable Documents............................................................................................................................................. 2

2.1 Reference Documentation................................................................................................................................. 2
2.1.1 Web Site(s)............................................................................................................................................................... 2
2.2 Dots & Boxes Project Documentation........................................................................................................ 3
2.2.1 User Manual (UM )- TBS....................................................................................................................................... 3
2.2.2 Detailed Design Documentation - TBS............................................................................................................... 3
2.2.3 System Test Procedure (STP) - TBS..................................................................................................................... 3
2.2.4 System Test Report (STR) - TBS........................................................................................................................... 3
2.2.5 Dots & Boxes Coding Standard - TBS................................................................................................................ 3

3 Context Diagram.......................................................................................................................................................... 3

4 Product Details............................................................................................................................................................4

4.1 Users................................................................................................................................................................................4
4.1.1 Who they are............................................................................................................................................................ 4
4.1.2 Inclusion strategy................................................................................................................................................... 4

5 Constraints.................................................................................................................................................................... 5

6 Use Cases............................................................................................................................................................................5

6.1 Normal............................................................................................................................................................................5
6.1.1 Analysis Use Case: Dots and Boxes game..........................................................................................................5
6.1.2 Design Use Case: Starting the game.................................................................................................................. 5
6.1.3 Design Use Case: Scoring a point...................................................................................................................... 6
6.1.4 Design Use Case: Winning the game.................................................................................................................. 6
6.1.5 Design Use Case: Restarting the game.............................................................................................................. 6
6.1.6 Design Use Case: Quitting the game.................................................................................................................. 6
6.1.7 Design Use Case: Getting Help........................................................................................................................... 6
6.2 Abnormal but possible use cases.................................................................................................................. 7

7 Functions/ Behaviors................................................................................................................................................ 7

7.1 Activation/Deactivation................................................................................................................................... 7
7.1.1 Activation................................................................................................................................................................. 7
7.1.2 Deactivation............................................................................................................................................................ 8
7.2 Game Playing............................................................................................................................................................... 8
7.2.1 Rules of the Game.................................................................................................................................................... 8
7.3 Control and Status Keeping............................................................................................................................. 8
7.3.1 Controls.................................................................................................................................................................... 8
7.3.2 Error Conditions..................................................................................................................................................... 9
7.4 Distinguishing Characteristics................................................................................................................... 10

8 Attributes...................................................................................................................................................................... 10

8.1 Defining......................................................................................................................................................................... 10
8.2 Distinguishing........................................................................................................................................................... 10
8.3 Get if you can............................................................................................................................................................ 10

9 Responsibilities.......................................................................................................................................................... 10

10 Unresolved Issues..................................................................................................................................................... 10

11 Assumptions.................................................................................................................................................................. 11

11.1 Hunches.................................................................................................................................................................... 11
11.2 Self-Evident........................................................................................................................................................... 11
11.3 Assumptions with Supporting Evidence.............................................................................................. 11
11.4 Impositions............................................................................................................................................................ 11

12 Data Elements.............................................................................................................................................................. 11

13 Design Decisions......................................................................................................................................................... 11

13.1 Preemptive Choices............................................................................................................................................ 11
13.2 Design Choices...................................................................................................................................................... 12

14 Risk...................................................................................................................................................................................... 12

14.1 Technical Risk..................................................................................................................................................... 12
14.2 Financial Risk...................................................................................................................................................... 12
14.3 Schedule Risk........................................................................................................................................................ 12
14.4 Risk Mitigation Plan....................................................................................................................................... 12

15 Document Conventions......................................................................................................................................... 12

16 Sample Displays.......................................................................................................................................................... 12

17 Glossary and Acronym List.............................................................................................................................. 12
 
 
 

1 Product Overview

1.1 Description of the Product

Dots and Boxes is a paper and pencil game that we propose to migrate to a computer form. Given a square or rectangular array of dots, two players take turns joining two adjacent dots with a horizontal or vertical line. When such a move adds the fourth side of a box, the player who did the deed claims the box (marking it as hers in some fashion) and must take an extra turn. If the same move closes two boxes, the player claims both boxes but still gets only one bonus move. A player who can complete a box is not obliged to do so. The game ends when all the boxes are taken. The player who closed more boxes wins - there can be no ties since all the boxes must be "owned" to end the game and there are always an odd number of boxes. We propose to develop a computer-based version of the game, which will support two humans playing each other. There is no intent to immediately implement a computer opponent in the game, since the strategy can be quite involved. Dots and Boxes is currently in vogue among mathematician's and game theorists - a book about Dots and Boxes strategy was not only published this year, it was reviewed in Scientific American.

1.2 Purpose of the Product

Dots and Boxes is most frequently used as a "time passing" game, but has been used by scientists and economists in strategic gaming and algorithmic development. Dots and Boxes will be a computer implementation of a paper and pencil game. Our implementation will automate the board creation, move, and scoring processes.

1.3 Problem Solved by the Product

There are already multiple versions of Dots and Boxes available for computers. We selected it because it is a suitable project for developing a Java skill base and it provides a scalable task scope. That is, it has the advantage of being straightforward to develop a 2-person game, but if we decide to develop a algorithm to support computer vs. human play, the task could get extremely complex and offer opportunities for algorithm development, timing trade-offs, etc. As a result, it has the potential of continuously evolving.

1.4 Objectives of the Product

N/A.

1.5 Special Considerations

This project will be our first in Java and will be the first effort at developing and documenting with any Java development tools. As a result, the cost of technology introduction must be factored into schedule and technical expectations.
 

1.6 Benefit to Business

N/A.

1.7 Schedule and Financial Considerations

The total development schedule is 8 weeks with one person working part time.

1.8 Expectations and Limitations of this Product

Dots and Boxes will run on Windows NT or ME platforms, and support displaying the game board and scoring for two human opponents playing at the same computer, i.e. Dots and Boxes will not support networked play. It is not expected that the game will remember status from game to game.

1.9 Summary Description

This program will be written in Java 2, version 1.3. Its primary target platform will be a personal computer running Windows, running NT or Windows 95, 98 or ME. It will act as rule interpreter for the game of Dots and Boxes for two people. The user interface will be point and click on graphical objects representing the dots. The boxes will be constructed of lines between the dots, and the "owner" of the box will be indicated by the color of the interior of the box. Minimal help will be provided, in the form of a short description of the game.

1.10 Acceptance criteria

The product will be accepted based on (1) submission of a System Test Report, with results acceptable to Dr. Kaplan or his representative and (2) three successful plays of the game, as described in the User Manual. Dr. Kaplan or his representative must be one of the players of the game. "Successful" will be defined as operating as described in the User Manual and meeting the performance requirements described in this document. The latest released version of the User Manual will be used. The tests will be run on a Windows platform in JBE room TBS.

2 Applicable Documents

2.1 Reference Documentation

2.1.1 Web Site(s)

http://www.well.com/user/argv/java/dots.html - I used the dots and boxes game at this web site as a model for my implementation.

2.2 Dots & Boxes Project Documentation

User Manual (UM )- TBS
Detailed Design Documentation - TBS
System Test Procedure (STP) - TBS
System Test Report (STR) - TBS
Dots & Boxes Coding Standard - TBS

3 Context Diagram

(Please see the description of this section in the annotated SRS.)

4 Product Details

4.1 Users

4.1.1 Who they are

Note: No disfavored users have been identified at this time.
 
Name:
Brief Description:
Status: Favored, Disfavored, or Ignored
Game Player
Own or has access to a computer with access to the web
Favored. We do not intend to generate or handle any media, all our delivery will be done using web downloads.
Stand alone computer owner
Owns computer but is not connected to the web
Ignored - Will not provide alternate installation mechanism 
Non-computer literate person
Does not use a computer gracefully. Does not understand use of mouse.
Ignored - Help will be minimal
People who cannot operate a mouse 
Cannot use the mouse with sufficient resolution to accurately point and click on the game pieces to play the game
Ignored - No accommodation will be made to increase the size of the game pieces for ease of use.
Hackers
Attempt to use various applications to break the security on one or more computers.
Ignored - No special precautions will be taken to prevent access to the computer system files via this game.

4.1.2 Inclusion strategy

The users will be included by limited interaction, that is, we will ask representatives from the favored user group to periodically run our game. While they are using the game, we will watch their behavior to notice things that appear to be unclear or incorrect. At the end of the game session, we will ask for their comments on the game.

5 Constraints

C1. When the Dots & Boxes gameboard is displayed, it will consist of an 8 x 8 grid of dots.
C2. When Dots & Boxes controls are invoked, the new or modified display will appear within 1 second.
C3. When a new player fitting the favored user description sits down to use the game after game initialization, he/she shall be able to successfully play the game with zero or one interventions by game developers.

6 Use Cases

6.1 Normal

6.1.1 Analysis Use Case: Dots and Boxes

The user will initiate the game and the game board and game controls will be displayed. The game board consists of a square grid of dots. The players alternate connecting the dots with lines. When dots are connected in such a way that the lines form a square, the player who connected the dots that closed the square gets a point and a continuation of his turn. The square is visually tagged as belonging to her. The player's turn continues until he can no longer make squares, when play reverts to the other player. The game ends when all the squares on the board are "owned" by one or the other player. The winner is the player with the most squares. At the end of the game, or at any point during the game, the players can start a new game (losing the existing one). At any point in the game, the players have access to help information.

6.1.2 Design Use Case: Starting the Game

Precondition: The game and its help file has been installed on the computer and the user is in the directory containing the files.
Postcondition: Play of the game is initiated.
Use Case Description: The user types "java dotsandboxes". The game window will be displayed. The game window shows the game "matrix", a message/status area, a scoring area and a other controls. The game matrix consists of a grid of dots. Both player's scores will be set to zero. The message status area will inform the user that it is player 1's turn. Player 1 takes his turn by selecting an area between two dots on the grid. After the area is selected, the line segment that connects the two dots is colored in, in a color corresponding to Player 1, and the status message states that it is Player 2's turn. Player 2 selects an area between two dots, it is colored in the color corresponding to Player 2, and the turn is passed back to Player 1. Play continues in this fashion until one of the players completes a square, Use Case 6.1.3.

6.1.3 Design Use Case: Scoring a Point

Precondition: Use Case 6.1.2 and play has progressed so that lines exist that form three sides of a square. The lines can have been placed by either player
Postcondition: The square the four lines created is "tagged" with the player who completed the square. The score of the person who completed the square is incremented by one. The player who scored the point gets an additional turn.
Use Case Description: The player whose turn it is selects the area between two dots, thus completing a square connecting four dots. The Dots & Boxes game will draw a solid square inside the square formed by the lines and the score will be incremented for the player who completed the square. The turn will stay with player who scored the point, and will stay with her until she fails to complete a square on a move.

6.1.4 Design Use Case: Winning the game

Precondition: Use Cases 6.1.2 and 6.1.3 repeated until the total score between the two players is 48.
Postcondition: The gameboard with 49 completed squares is displayed. The winner of the game is identified status area. The gameboard will be unchanged, awaiting player direction to quit or start another game.
Use Case Description: When either player completes the last square, the game is over. The player with the most points wins. A message will be displayed showing the winner of the game. The game will wait for user input to quit or start another game.

6.1.5 Design Use Case: Restarting the Game

Precondition: Use Case 6.1.2 has been executed. Play can either have begun or not.
Postcondition: The gameboard is cleared of all player lines and squares and the scores are reset to zero.
Use Case Description: At any time after game initiation, a player can invoke the Restart control.

6.1.6 Design Use Case: Quitting the Game

Precondition: Use Case 6.1.2 has been executed. Play can either have begun or not.
Postcondition: The Dots & Boxes window is closed and the program shut down.
Use Case Description: At any time after game initiation, a player can invoke the Quit control.

6.1.7 Design Use Case: Getting Help

Precondition: Use Case 6.1.2 has been executed. Play can either have begun or not.
Postcondition: The Dots & Boxes help file is displayed.
Use Case Description: At any time after game initiation, a player can invoke the Help control. A help file containing the Dots & Boxes game rules and instructions as to the use of the game controls will be displayed.

6.2 Abnormal but possible use case

Precondition: Use Cases 6.1.2 and 6.1.3 have been executed. Play has begun.
Postcondition: The turn returns to the player making the erroneous move.
Use Case Description: If a player tries to
a. Select a line between two dots that are already connected
b. Select a line between two dots that would form a diagonal line if connected
c. Select a line between two dots that are further away from each other than one unit of distance
Dots & Boxes will display an error message.

7 Functions/ Behaviors

All contractual requirements are located in this section and Section 4 ( Constraints). All requirements in this section are numbered as fourth level paragraphs. All the following requirements assume that the game executable has been installed on the computer.

7.1 Activation/Deactivation

7.1.1 Activation

7.1.1.1 Defining - When a DOS window is open and a user enters "java dotsandboxes", the Dots & Boxes program will cause the gameboard and controls to be displayed.

7.1.1.2 Defining - When the user invokes Dots & Boxes, then the display will have the following active components:

a. A gameboard consisting of an 8 x 8 grid of dots with line segments connecting them.
b. A quit control
c. A restart control
d. A help control
e. A status area
f. A score area

7.1.1.3 Defining - When Dots & Boxes is initialized, the game display shall have the following values:

a. Quit control shall be active
b. Restart control shall be active
c. Help button shall be active
d. Status display shall prompt start of game
e. Scoring windows shall be set to zero
f. All line segments and internal squares shall be the same color as the gameboard background

7.1.2 Deactivation

7.1.2.1 Defining - When the user invokes the quit control at any time while the game is active, Dots & Boxes shall close all game windows and remove all Dots & Boxes artifacts from the screen.

7.2 Game Playing

7.2.1 Rules of the Game

7.2.1.1 Defining - When a user selects two adjacent horizontal or vertical dots to connect, Dots & Boxes shall draw a line between the two dots, in a color corresponding to the player who made the dot selection.

7.2.1.2 Defining - When a user connects the dots to form the line forming the fourth side of a square, Dots & Boxes shall

a. mark the square with an indication of the "owner" of the square and
b.the turn shall remain with the player who made the square.
Note: In the paper and pencil game, the players don't necessarily keep a running score; they sometimes total their scores after all the plays are taken. Since a running score is not an essential characteristic of the game, the score keeping function is addressed under "Controls".

7.2.1.3 Defining - When the users' total score is 49, Dots & Boxes shall identify the player with the most points.

7.3 Control and Status Keeping

7.3.1 Controls

7.3.1.1 Defining - When the user invokes the Restart control, the Dots & Boxes game shall

a. Set Player 1 score to 0
b. Set Player 2 score to 0
c. Clear the gameboard of all colored lines and squares.
d. Display a message to indicate Player One's turn

Note: Restart and initialize set the game to the same state.

7.3.1.2 Defining - When a user has taken a turn, the Dots & Boxes Status Display shall update to show the player whose turn it is currently.

7.3.1.3 Defining - When a user takes a turn that causes the final square on the game board to be filled in, the Dots & Boxes Status Display shall display a message identifying the winning player.

7.3.1.4 Defining - When either user creates a square, Dots & Boxes shall increment the corresponding player score box to show the current score.

7.3.1.5 Defining - When a player invokes the Help control, Dots & Boxes shall display a text window containing

a. The rules of the game
b. The effect of the game controls on the state of the game.

7.3.1.6 When the Help information is visible, play can continue. (Help is not modal).

7.3.1.7 When the Help information is visible, there shall be a control to close it.

7.3.1.8 Defining - When Dots & Boxes is active, the users can invoke the Restart control at any time during the play of the game.

7.3.2 Error Conditions

7.3.2.1 When the user connects two dots that would cause a diagonal line to be drawn, Dots & Boxes shall

a. display an error message and
b. the turn shall stay with the player who made the illegal move.

7.3.2.2 Defining - When the user connects dots that already have a line between them, Dots & Boxes shall

a. display an error message and
b. the turn shall stay with the player who made the illegal move.

7.3.2.3 Defining - When the user connects non-adjacent dots, Dots & Boxes shall

a. display an error message and
b. the turn shall stay with the player who made the illegal move.

 

7.3.3 Distinguishing Characteristics

7.3.3.1 When the user is playing, Dots & Boxes shall allow the user save the game state in a named file.
7.3.3.2 When a user is playing, Dots & Boxes shall allow her to select to revert the game state to that of a saved game.
7.3.3.3 When a user is playing, Dots & Boxes shall allow him to select from multiple grid sizes.

8 Attributes

8.1 Defining

Compliant (Conform to the rules of the game, activate from console as expected)
Simple (Interface uses common windows controls, no pull down menus, results of play easily detectable, can be played using only a mouse, quick reacting)
Informative (Help always available, help for both game rules and game controls)

8.2 Distinguishing

Reusable (games can be saved at any point for replay during the game session, games can be saved across sessions)

8.3 Get if you can

Flexible (played by two humans or against the computer)

9 Responsibilities

Mine, all mine

10 Unresolved Issues

Do I have to invent my own controls, or can I use Java built-in classes?
Where should the intelligence reside, the dots or the space between them?
Are there any unidentified functions that will require a pull-down menu?

11 Assumptions

11.1 Hunches

None so far. I think.

11.2 Self-Evident

It has to have a small scope, or I can't do it in the time period.

11.3 Assumptions with Supporting Evidence

I can make my own decisions about interface "goodness", i.e. I can elect not to have pull down menus.

11.4 Impositions

I can't design it to run on a VAX 11/750 or an IBM mainframe - it has to run on something I can demo here.

12 Data Elements

The game program will require storage and organization of the following data elements:
a. Line position
b. Dot position
c. Corner dots
d. Running scores
e. Current player
f. Error messages
g. Status messages

13 Design Decisions

13.1 Preemptive Choices

The player's lines and squares will be distinguished by associating a color with each Player. Player 1 will be dark blue and player 2 will be light blue. The text associated with Player 1's score box, the lines she makes, and the boxes that are filled in will be dark blue. The same entities will be light blue for Player 2.

13.2 Design Choices

The design choices for the project are:
a. Code in Java
b. Use UML as a design language
c. Select Windows NT as a platform.

14 Risk

14.1 Technical Risk

The major technical risks are:
a. I won't be able to get the gameboard display looking right and
b. I won't be able to develop the logic to detect when a square has been closed and take appropriate action.

14.2 Financial Risk

N/A

14.3 Schedule Risk

There is an 8 week development schedule.

14.4 Risk Mitigation Plan

In order to address the technical risks, my first programming task will be to develop the gameboard and the "square" logic. There will be no other controls, and the "square" logic will only demonstrate that the game can detect when a square is closed and color it, not that it can correctly color or score the square.

15 Document Conventions

All measurable requirements are in fourth level paragraphs in Section 7.

16 Sample Displays

17 Glossary and Acronym List

CCB - Configuration Control Board
N/A - Not applicable
SRD - System Requirements Document
TBS - To Be Supplied
TBD - To Be Determined
UM - User Manual