Documente Academic
Documente Profesional
Documente Cultură
CS 430
Requirements Specification
February 14th, 2010
Benjamin Carpenter
Ryan Daugherty
Jack Dehlin
Jay Greene
Table of Contents
1.0 Introduction..................................................................................................................8
1.1 Goals and objectives................................................................................................8
1.2 Statement of scope...................................................................................................8
1.3 Software context.......................................................................................................8
1.4 Major constraints.....................................................................................................8
2.0 Usage scenario..............................................................................................................8
2.1 User profiles..............................................................................................................8
2.2 Use-cases...................................................................................................................8
3.0 Word Search.................................................................................................................9
3.1 Data Description......................................................................................................9
3.1.1 Data objects.....................................................................................................10
3.1.2 Relationships...................................................................................................10
3.1.3 Complete data model......................................................................................10
3.1.4 Data dictionary................................................................................................10
3.2 Functional Model and Description.......................................................................10
3.2.1 Description for Functions...............................................................................10
3.2.1.1 Startup......................................................................................................10
3.2.1.2 New Game.................................................................................................11
3.2.1.2.1 Create Random Puzzle.....................................................................11
3.2.1.3 Main Game Function...............................................................................11
3.2.1.3.1 Draw the Board.................................................................................11
3.2.1.3.2 Select Letters.....................................................................................11
3.2.1.4 Menu Functions........................................................................................11
3.2.1.4.1 Submit a Word..................................................................................11
3.2.1.4.1.1 Dictionary Check.......................................................................12
3.2.1.4.2 Clear the Board.................................................................................12
3.2.1.4.3 Help....................................................................................................12
3.2.1.4.4 View Submitted Words.....................................................................12
3.2.1.4.5 Finish Game......................................................................................12
3.2.1.4.5.1 Calculate Score...........................................................................12
3.2.1.5 High Score............................................................................................12
3.2.1.6 Exit Game.............................................................................................12
3.2.2 Software Interface Description......................................................................12
3.2.2.1 External machine interfaces...................................................................12
3.2.2.2 External system interfaces......................................................................13
3.2.2.3 Human interface......................................................................................13
3.2.3 Control flow description.................................................................................13
3.3 Behavioral Model and Description.......................................................................13
3.3.1 Description for software behavior.................................................................13
3.3.1.1 Events........................................................................................................13
3.3.1.1.1 New Game Button Pressed...............................................................13
3.3.1.1.2 Letter Selected...................................................................................13
3.3.1.1.3 Menu Button Pressed........................................................................13
3.3.1.1.4 Submit Button Pressed.....................................................................13
2
1.0 Introduction
This document specifies the requirements for the production and design of the Game
Suite software for the Google Android operating system. The product will be a suite of
five simple and easy games for a user to play. The games include a word search, connect
four, battle ship, hangman, and a Sudoku. The first four games will be uniquely
developed and the fifth will use an open source Sudoku. The user interface will be easy to
use and allow the user to go in-between games with ease. It will use the cell phone
operating system Android, which is on a lot of cell phones today. The android operating
system uses a market place to sell applications for the phone.
1.1 Goals and objectives
The goal of this project is to produce an interactive and entertaining application
for the Android marketplace. This app will be a suite of several smaller games,
one of which is open source, the rest custom made. They will be playable on any
phone supporting the android operating system with access to the internet.
1.2 Statement of scope
The only input to this project is the user's attention and strategic moves; and the
only output is the entertainment that is a consequence of the input.
1.3 Software context
The big picture of this project will be to provide entertainment for anyone with
access to an Android device.
1.4 Major constraints
Since this project can easily be broken down into many smaller functioning parts,
there are few major constraints. As long as the Android Marketplace is up and
running and people are still using the Android OS, it will be possible to market,
maintain, and operate this application.
2.0 Usage scenario
2.1 User profiles
Users of the system will be anyone who has a mobile device operating the
Android OS with access to the Android Marketplace. The application will be
accessible to everyone by these means and require only navigation of the menus
and games through the touch-screen interface.
2.2 Use-cases
Figures one and two show the different use cases for the game suite. Figure one
show the interaction between the user and the Android OS. Figure two show the
interaction between the user and the main menu.
Figure One: Use Case Diagram for interaction with the user and the Android OS
Figure Two: Use Case Diagram for interaction with the user and the main menu
10
is the users cell phone that hosts the game. The game must be
compatible with the Android operating system.
3.2.2.2 External system interfaces
To play the game, the user must be connected to the internet either
through the phones data network or Wi-Fi. The Google web
dictionary search is to check to make sure the word exists and is
not seen by the user.
3.2.2.3 Human interface
This is the main interface that the user will interact with. The
interface will allow the user to use the phones touch screen
services and analog buttons. This interface is clear and easy
to use. It shows buttons and text so the user can understand
what is going on.
3.2.3 Control flow description
The control flow of the word search starts when the user starts a new
game. After the new game is started there will be different states of the
game. This continues till the game is finished. This described in section
5.0 and its subsections.
3.3 Behavioral Model and Description
3.3.1 Description for software behavior
3.3.1.1 Events
3.3.1.1.1 New Game Button Pressed
A new game is started, puzzle made, board is drawn.
3.3.1.1.2 Letter Selected
When the user touches a box, the box is documented.
After it is documented then the board is redrawn with
the box highlighted. This is done till another event
happens.
3.3.1.1.3 Menu Button Pressed
When the phones menu button is pressed a menu
pops up.
3.3.1.1.4 Submit Button Pressed
When the submit button is pressed the word is
checked to see if it is misspelled or not positioned
right.
3.3.1.1.5 Word is not misspelled
Word is checked to see if they are in correct positions.
13
14
15
16
The relationships between the data objects above can be seen in the figure
below. The user will submit data and the program will pass around that
data.
4.1.3 Data dictionary
If the game is closed at the end of a round or before any player places a
chip when a new game is started then no data is stored other than the tally
of wins. If the game is closed mid round then the state of the board is
stored locally and reinitialized upon re-launching the application.
4.2 Functional Model and Description
4.2.1 Description for Functions
4.2.1.1 Startup
This function is initiated when the Connect Four game is pressed
from the home screen. The function starts a new activity that
shows the main menu for the game.
4.2.1.2 New Game
This function is initiated at the initial screen when the new game
button is pressed. After the button is pressed, it creates an empty
board of seven by six, draws the board, then passes off the
responsibility to the main game function.
4.2.1.3 Main Game Function
After a new game is started, the main game function runs
functions to watch the user actions and act accordingly.
4.2.1.3.1 Placing a Chip
This function is supported by the android
onclicklistener. When a player selects a column to
place their chip the lowest empty space in that
column is changed to their color.
4.2.1.3.2 Check for Victory
Each time a chip is placed the game will check if that
player has won by trying to find three adjacent chips of
their color in any direction.
4.2.1.4 Menu Functions
During the game the user can press the menu button to bring up
options. The menu option is used to conserve space on the screen.
4.2.1.4.1 New Game
This function clears the board and begins a new
game.
17
4.2.1.4.2 Help
This function displays the rules of the game.
4.2.1.4.4 View Wins
This function displays the total number of wins for
each color, black and red.
4.2.1.4.5 Exit
This function ends the current game and takes the
user to the main menu of the game. If any chips have
been placed on the board the locations of those chips
is stored on the devise and reloaded once the
application is restarted.
4.2.2 Software Interface Description
Connect Four uses one interface that the user can see. The one that they
see is through the cell phone. The cell phone must be running the Android
operating system.
4.2.2.1 External machine interfaces
The game will run on two different machines. One is an emulator
of a cell phone that is used for development and testing. The other
is the users cell phone that hosts the game. The game must be
compatible with the Android operating system.
4.2.2.3 Human interface
This is the main interface that the user will interact with. The
interface will allow the user to use the phones touch screen
services and analog buttons. This interface is clear and easy
to use. It shows buttons and text so the user can understand
what is going on.
4.2.3 Control flow description
The control flow of the Connect Four game starts when the user starts a
new game. After the new game is started there will be different states of
the game. This continues till the game is finished.
4.3 Behavioral Model and Description
4.3.1 Description for software behavior
4.3.1.1 Events
4.3.1.1.1 New Game Button Pressed
A new game is started, empty board is drawn.
4.3.1.1.2 Column Selected
When the user touches a box at the top of a column
the lowest empty space in that column is switched to
18
20
22
23
The next data object is the answer. The answer will be generated at the
beginning of each new game accessing a predefined list of six letter words.
The answer will be stored in an array of characters.
The third data object is the guess array. The guess array will consist of six
elements each of which is a character array. It will be generated from an
Edit Text field submitted by the user. If the guess is a valid word (I.e. has
six characters, and all characters are letters) then the guess will be
converted to a character array and added to the guess array. Otherwise the
guess will be ignored, the user will be prompted of the mistake and will be
able to submit another guess.
The final data object will be the final score when the game is ended. The
score is calculated by counting the number of words correctly answered
before ending the game, multiplying that number by one thousand and
subtracting the number of guesses taken multiplied by 50. The game will
locally keep the highest score for display.
6.1.2 Relationships
The relationship between the data objects above can be seen in the
following figure. The user will submit data and the program will process
that information accordingly.
6.1.3 Complete data model
All of the data excluding the word dictionary will be stored on when the
program itself is running. Once the program is stopped, or a new game is
initiated, all data will be discarded. The word dictionary will be stored on
the phones memory and will be accessed at each initiation of a new game,
at which time a random word will be selected as the answer for that
particular game.
6.2 Functional Model and Description
6.2.1 Description for Functions
6.2.1.1 Start Up
This function in initiated when the word guesser game is pressed
from the home screen. The function starts a new activity that shows
the main game screen for the word guesser.
6.2.1.2 New Game
This function in initiated once the word guesser button is pressed
from the game suite home screen and when the new game button is
pressed from the menu of word guesser. Once the button is pressed,
a new answer is selected from the word dictionary, the guess array
is reinitiated to the default values, the guess count is reset to zero
and the correctness field is set to false.
6.2.1.2.1 Answer Generator
When a new game is started, a random number between 0
and 600 is generated at which time the program traverses
the word dictionary for the generated amount of interactions
and returns that word as the correct answer for the game.
6.2.1.3 Main Game Function
After a new game is started, the main game function runs functions
to watch the user actions and act accordingly.
6.2.1.3.1 Submit Guess Function
Each time the OK button located adjacent to the Edit Text
field is selected a function is called to first check the
validity of the guess (i.e. current length and correct
characters). This guess is first stored as a String; however,
will be passed through the split() function to create a
character array of the guess for comparison.
6.2.1.3.2 Split Functional
Once the guess string is retrieved from the Edit Text field,
this function is called to create a character array of the
guess. A string is passed to the function and a character
array is returned. This function is also used for the correct
25
It shows buttons and text so the user can understand what is going
on within the application.
6.2.3 Control flow description
The control flow of the word guesser starts when the user starts a new
game. After the new game is started there will be different states of the
game. This continues till the game is finished. These individual game
states are described in section 6.2.3.2 and its subsections.
6.3 Behavioral Model and Description
6.3.1 Description for software behavior
6.3.1.1 Events
6.3.1.1.1 New Game Button Presses
A new game is started, answer fetched from the dictionary.
6.3.1.1.2 Menu Button Pressed
When the phone's menu button is pressed a menu pops up.
6.3.1.1.3 OK Button Pressed
When the OK button is pressed the text in the Edit Text
field is retrieved and checked for correctness. Then the
guess is compared against the answer.
6.3.1.1.4 Guess is Invalid
Edit Text field is clears and the user is prompted that the
previous guess was incorrect in syntax.
6.3.1.1.5 Character Not Found
The specific character in guess is printed to the screen in the
default grey text and the guess count is incremented.
6.3.1.1.6 Character Found in Correct Position
The specific character in the guess is printed in RED to
signify it is a correct letter and in the correct position.
6.3.1.1.7 Character Found in Incorrect Position
The specific character in the guess is printed in YELLOW
to signify it is a correct letter; however, in an incorrect
position.
6.3.1.1.8 View High Score Button Pressed
The high score of the game is displayed to user as well as
the score of the current game (if any).
6.3.1.1.9 Help Button Pressed
The rules are displayed in a dialog box.
28
29
The game will end a show a dialog box with the score as
well as a congratulation if a new high score was set. It will
return to the game suite's main menu.
6.3.1.2.7 Show Help
A dialog box will show the rules of the game.
6.3.1.2.8 Display Score 0
When a score is not found then a default zero is displayed
when the View High Score button is pressed.
6.3.1.2.9 Display High Score
Retrieves and displayed the high score from memory when
the View High Score button is pressed.
6.3.1.2.10 Highlights Letter
Turns character RED when the letter is in the answer and in
the correct position. Turns character YELLOW when the
letter is in the array but in an incorrect position.
6.3.2 State Transition Diagrams
30
7.0 Sudoku
7.1 Data Description
The word search utilizes a couple of different data objects. These objects are used
for passing data around and keeping track of information. The data keeps track of
numbers, difficultly level, tiles, and hints.
7.1.1 Data objects
The first data object is the user. The user will select a tile to enter a
number into. The user can select any of the tiles in the 9x9 board. Once a
tile is select a dialog box will with the available numbers. The user will
select a number and it will be placed into the tile.
The second data object is the hints. When the tile selected dialog box
appears only the available numbers appear. This is helped out by the hint
function, which calculated the used numbers. The hint function also colors
tiles according to how many numbers can go into the tile.
31
The last data object is the difficulty level. When a new game is started, the
user selects an easy, medium, or hard level. Then a board is drawn by that
difficulty.
7.1.2 Relationships
The relationships between the data objects above can be seen in the figure
below. The user will submit data and the program will pass around that
data.
7.1.3 Complete data model
7.2.1.2.2.1 Music
This function turns the music on and off.
7.2.1.2.2.2 Hints
This function turns the hints on and off.
7.2.1.2.3 Exit
This function exits the main menu of the Sudoku and takes
the user back to the main menu of the game suite.
7.2.1.3 New Game
This function is activated when the new game button is pressed.
After it is pressed a dialog box appears with the user to select the
difficulty level. After the selection, this function loads the puzzle
and starts the main game function.
7.2.1.3.1 Difficulty
This function allows the user to select the difficulty level.
The difficulty levels are easy, medium, and hard. Once the
difficulty is selected it is store in the data object. Then the
puzzle is retrieved based on the difficulty.
7.2.1.3.2 Load Puzzle
This function takes the puzzle from the difficulty data
object and passes it to the main game function to be drawn.
7.2.1.4 Main Game
This function loads the main game and allows the user to play the
game. When a tile is selected, it shows the numbers that can be
played. It calls the hints function to color squares differently. This
function is run all the numbers are filled or the game is exited.
7.2.1.4.1 Draw Board
Every time a number is selected then the board is redrawn
to show those changes. This function draws the lines,
numbers, background, and different colors for the hinted
tiles.
7.2.1.4.2 Select Tile
This function deals with when a user selects a tile on the
board. When a tile is selected it is turned a different color.
It then calls the hints function and brings up the select
numbers function.
7.2.1.4.3 Select Numbers
33
35
7.3.1.2.4 Menu
This page is shown when the analog menu button is pressed
on the phone. It shows a settings button.
7.3.1.2.5 Settings
The settings page allows the user to change the settings for
the music and hints of the game.
7.3.1.2.6 Hints
This displays a button to turn on/off hints.
7.3.1.2.7 Music
This displays a button to turn on/off music.
7.3.1.2.8 Difficulty Selected
This displays a dialog box with the options to select the
difficulty of the game.
7.3.1.2.9 Tile Select
This is the main page of the game to be displayed. It shows
the board drawn and allows the user to select a tile or end
the game.
7.3.1.2.10 Number Select
From the hints function the numbers available are retrieved.
It displays the number is a dialog box with a button for
each available number.
7.3.2 State Transition Diagrams
36
- Move between the Welcome screen and the available games multiple
times and in varying orders.
9.1.2 Word Search
- Select known valid words for multiple puzzles.
- Select known invalid words.
- End game, exit program, and re-launch.
9.1.3 Connect Four
- Run through multiple games from start to finish with varying end
game scenarios.
- Exit program mid game and re-launch.
9.1.4 Battleship
- Run through multiple games from start to finish with varying end
game scenarios.
- Exit program mid game and re-launch.
9.1.5 Hangman
- Run through multiple games from start to finish with varying end
game scenarios.
- Exit program mid game and re-launch.
9.1.6 Sudoku
- Run through multiple games from start to finish with varying end
game scenarios.
- Exit program mid game and re-launch.
9.2 Expected software response
9.2.1 Welcome Screen
- Individual should launch and close cleanly and smoothly, returning
to the Welcome screen when closed.
9.2.2 Word Search
- Valid words should be accepted and added to the current score.
- Invalid words should be rejected.
- Game should open and close cleanly and high score should be
persistent when re-launching.
9.2.3 Connect Four
- Individual chips should be placed properly when specific columns are
selected. The game should end when four chips of the same color connect
horizontally, vertically, diagonally.
- Game should open and close cleanly and game state should be restored if
the application was closed mid game.
38
9.2.4 Battleship
- Individual 'shots' should register as hits when they occur at a location
occupied by an opponents ship. The game should end when all enemy
ships have been destroyed
- Game should open and close cleanly and high score should be
persistent when re-launching.
9.2.5 Hangman
- Individual letters should register as being part of the target word if they
are. Incorrect letters should result in the addition of a body part to the
'hangman'. The game should end when either the 'hangman' is complete or
the target word is completed.
- Game should open and close cleanly and high score should be
persistent when re-launching.
9.2.6 Sudoku
- Individual entries should be registered on the board and the game
should end when the puzzle has been solved.
- Game should open and close cleanly and high score should be
persistent when re-launching.
9.3 Performance bounds
All games and their individual subsystems should run smoothly and quickly.
10.0 Appendices
10.1 Product Strategies
Our product will be likely submitted in the Android Market Place. It will likely be
free to the user and will require no advertisement.
10.2 Supplementary information
The following is a screen shot of the emulator we use to develop our program.
39
40