Hangman Solitaire
Software Requirements Specification
Functional
Requirements Nonfunctional
Requirements UI
Prototype
Informational Requirements
Appendix
Executive Summary
Hangman Solitaire is a computer-based version of the classic
two-player
word game of the same name. The human player competes against the
computer to guess a word the program has selected at random.
General
Description
Product Perspective
The benefit of this program is primarily that it allows someone to
play
as a solitaire game without requiring another person to participate.
Product Features
The application's purpose is to simulate the word game
"Hangman."
The major features are:
-
Obtain a hidden word from a remote computer on the internet.
-
Manage the game play: getting the player guess, evaluating it, and
updating
the game board.
-
Determining if the game is won or lost.
-
Allow the user to specify an alternate user interface.
User Characteristics
Hangman is designed for personal computer users who enjoy simple
solitaire
word games. Hangman is purely recreational software with little or no
utilitarian
value. The user is assumed to be competent using a WIMP interface
(windows,
icons, menus, pointers) to operate simple computer games such as
Minesweeper
or Klondike Solitaire. The user is assumed to be familiar with
the
rules of Hangman. It is assumed the user knows how to start Java
applications
from the command prompt and provide command line parameters.
Assumptions and dependencies
Hangman is dependent upon the Hangman Word Server application. Word
Server must be running in order for Hangman to obtain a hidden word to
use for the game. Word Server can be running on the same computer, or
on
a remote computer in which case the computer running Hangman will need
an active network connection to the remote computer.
Hangman uses hidden words in English.
Hangman assumes the words obtained from the Word Server are valid.
Scheduler will run on Windows 9x/XP and Linux platforms.
General Constraints
none.
Hangman Functional Requirements
A. Starting the Application
Allow the user to enter on the command line the IP address of a remote
computer that is running a Hangman Word Server. If the user
doesn't
provide an IP address, use as a default the address "localhost."
At the start of each game the application will request a word from
the
Hangman Word Server specified by IP address.
The word obtained from the Word Server will be designated as the
"hidden"
word the player tries to guess.
If no connection can be made to a Word Server on the given IP
address
display an error message on the console "Apparently no hangman word
server
is running at <IP address>."
If a word is obtained from the Word Server, game play begins by
offering
the player their first turn.
B. Playing a game
At each turn the application will display a visual indicator of how
many
letters are in the hidden word and if any of the letters have been
correctly
guessed they are shown in the proper position in which they appear in
the
word.
The application will display a "guess count" which shows how many
incorrect
guesses the player has made. An incorrect guess is guessing a
letter
which is not in the hidden word.
The application will allow the player to enter a letter.
If the letter entered is not between A and Z display a message
"Invalid
move" and allow the player to guess again (without penalty).
When the player enters a valid letter the application will check to
see if the game is over and if not will continue to the next turn.
C. Ending a game
The player wins by correctly guessing all the letters in the hidden
word.
The player loses if he/she makes seven incorrect guesses.
If the player wins the application will display a congratulatory
message.
If the player loses the application will display a consolation
message
and will reveal the hidden word.
When the game is over (either win or loss) the application will
offer
the player an opportunity to begin another game.
If the player indicates they want to play again, a new game is
started.
If the player indicates they do not want to play again, the
application
is terminated.
Note: there is no way for a player to request termination of play
during
the middle of a game.
Word Server Functional Requirements
Hangman Word Server runs as a stand alone application independently
from
the Hangman Solitaire game.
When a client program makes a network connection to the server's
port
the server will respond by sending a character string then closing the
connection.
The character string will be randomly selected from a file of
english
words.
User Interface Requirement
When started, Word Server must display a message indicating the host
address on which it is running, e.g.:
WordServer running on IP Address: 129.65.17.17
Hangman Non-Functional Requirements
General Guidelines: Performance and reliability are not very
important.
Priority should be given to adaptability, maintainability, and
usability.
Operating Constraints
-
The program requires the JRE v1.4 with Swing from Sun Microsystems.
Platform constraints
-
The program requires a 486 or higher processor with 16 Megabytes of RAM
and 5 Megabytes of available hard drive space.
Modifiability
-
If it is desired to change the number of turns in a game, the developer
will be able to make the required changes in < 1 person-hours.
Adaptability
-
The user must be able to specify an alternate user interface at
execution
time on the command line.
-
Any alternate user interface must be able to "plug in" at run time
without
recompiling the application.
-
Any alternate user interface must implement the HangmanUI interface
provided
by Dr. Dalbey (see External Interfaces).
Documentation
-
A short (< 200 words) message explaining command line syntax should
be displayed if the user enters no command line parameters.
Portability
-
The program will run on Win 95/98/XP and Red Hat Linux 9.
Reliability
-
Since the program is purely for recreation and involves no user data,
reliability
is of low importance.
Security
-
The program will not access any user data files or programs.
-
The program will not alter or replace any system files.
Usability
-
A new user should be able to play a complete game of hangman in less
than
ten minutes.
-
A new user should commit less than one error in use of the game (e.g.
selecting
the wrong letter) every ten minutes.
-
A user who is familiar with the rules of Hangman be able to correctly
operate
the program without any written documentation.
Testability
-
(optional) If the user provides an IP address of zero then skip getting
a word from the Word Server and use a default word "calpoly" as the
hidden
word.
Deployment
-
The program is to be deployed as executable java bytecode files
(".class"
files) that must fit on a 1.2M flexible disk. They must use no specific
java package.
Performance
-
Desired Response Times (not critical) : At game start: less than five
seconds
After each turn: less than two seconds
Word Server Non-Functional Requirements
Performance
-
After receiving a request, the word server must respond in less than
half
a second.
Maintainability
-
It is desirable that the game administrator be able to modify the words
data file using a simple text editor.
-
Adding a new word to the word data file should take less than ten
minutes.
Behavioral Requirements
UI
Prototype
Informational Requirements
Data Model
Data
Flow Diagram
|
__________________________________________________________ |
|
description |
The number
of incorrect
guesses the player has made this game. |
|
definition |
0
<= guess count <= guess limit |
|
__________________________________________________________ |
|
description |
the number
of guesses
a user is allowed before they lose the game. |
|
definition |
guess limit
= 7 |
|
__________________________________________________________ |
|
description |
the word
the player
is trying to guess |
|
definition |
hidden word
= { alphabetic
character }30 |
|
|
|
|
__________________________________________________________ |
|
description |
the letters
that the
player has correctly guessed, in their proper position in the word. |
|
definition |
guessed
word = { alphabetic
character }30 |
|
__________________________________________________________ |
|
description |
whether the
user wants
to play again or not |
|
definition |
continue
choice = {y
| n } |
|
|
|
|
__________________________________________________________ |
Appendices
Glossary
- IP address
- internet protocol address: the location of a computer on the
internet (may
use the domain name).
- UI
- acronym for User Interface
Error Handling
Included in functional requirements.
File Formats
The word server data file is a plain text file that contains one word
per
line with no leading, trailing, or embedded blanks.
External Interfaces
The Hangman Solitaire game and the Word Server will communicate via
standard
internet socket communication.
The design of the user interface to the Hangman Solitaire game must
conform to the HangmanUI interface provided by Dr. Dalbey.
Engineering Analysis
Platform Choice (O/S and Language)
Java was chosen because the CSc dept computer labs support both Windows
and Linux operating systems and students may want to deploy the
application
on different platforms. Performance is not a big concern as the
application
is a simple word game without heavy computational demands, and the
slower
performance of Java is acceptable to gain its portability advantages.
Distributed Architecture
Separating the application into the game and server components allows
the word server component to be used with other applications.
Adaptability
In the future it is quite likely that developers may want to create
a different user interface for the game. To simplify this task, the
user
interface is separate from the game logic. Additionally, the interface
to which the UI design must conform is made public to allow third party
developers to create their own front end to our game.
Document History
Date |
Author |
Change |
9/26 |
JD |
limited word length to 30 in data dictionary |
9/20 |
JD |
Initial Release |