Android Req
-
Upload
merlin-sanzz -
Category
Documents
-
view
240 -
download
0
Transcript of Android Req
-
7/31/2019 Android Req
1/34
Android Game Suite
CS 430
Requirements Specification
February 14th, 2010
Benjamin Carpenter
Ryan Daugherty
Jack Dehlin
Jay Greene
1
-
7/31/2019 Android Req
2/34
Table of Contents
4.0 Connect Four ....................................................................................................................11
2
-
7/31/2019 Android Req
3/34
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 fivesimple 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 allowthe 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 ofwhich 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 scopeThe 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 contextThe big picture of this project will be to provide entertainment for anyone withaccess 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 profilesUsers 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 oneshow the interaction between the user and the Android OS. Figure two show the
interaction between the user and the main menu.
3
-
7/31/2019 Android Req
4/34
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
3.0 Word Search3.1 Data DescriptionThe 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
selected letters, selected words, and game scores.
4
-
7/31/2019 Android Req
5/34
3.1.1 Data objects
The first data object is the user. The user will select letters to make wordsfor the word search. The letter themselves are characters. Multiple selected
letters are formed to make a string. Once the user is content with the
selected word, it can be submitted to check if it is actually a word.
The second data object is the collection of selected words. These words are
stored in the form of a string and an array of tiles. If the submitted word iscorrect it is appended to the collection of selected words. If it is wrong then
the word is discarded.
The third data object is the final score when the game is ended. The score iscalculated by counting the number of letters submitted in the selected
words. The game will locally keep the highest score for display.
3.1.2 RelationshipsThe 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.
3.1.3 Complete data model
Figure three: Word Search Complete Data Model
3.1.4 Data dictionary
All the data except for the high score is only stored when it is running. Oncethe program is ended all data will be discarded. The high score will be
stored on the phones memory and shown at the startup screen.
3.2 Functional Model and Description
3.2.1 Description for Functions3.2.1.1 Startup
This function is initiated when the word search game is pressed fromthe home screen. The function starts a new activity that shows
the main menu for the game.
5
-
7/31/2019 Android Req
6/34
3.2.1.2 New Game
This function is initiated at the initial screen when the new gamebutton is pressed. After the button is pressed, it creates a random
puzzle, draws the board, then passes of the responsibility to the main
game function.
3.2.1.2.1 Create Random Puzzle
When a new game is started, this function randomlypicks 81 numbers. The range of the numbers is 0 to
25 and is then converted to character to represent a
letter. The letters are then stored in an array.
3.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.
3.2.1.3.1 Draw the Board
Every time an action or function is called the board isredrawn to show the changes. The function draws a
9x9 board with the letters inserted into each position.
The function looks at an array to see which wordswere already correctly selected. These words are
drawn a different color.
3.2.1.3.2 Select Letters
This function is supported by the android
onclicklistener. When a user selects a letter, it records
it in an array. It keeps track of the order that the userpresses the letters in.
3.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.
3.2.1.4.1 Submit a Word
After letters are selected the user can submit the word
to see if it is a correct word. The function calls
dictionary check and gets the result. If it is a word,then the word is added to the submitted word data
object. If it is not a word, then the screen shakes. After
the word functions are done, the selected is clearedwith the clear function.
3.2.1.4.1.1 Dictionary Check
6
-
7/31/2019 Android Req
7/34
When a word is passed into this function it uses the
Google online dictionary search. It gets the source
page of the search and parses it to see if the word isin the dictionary. It returns the result.
3.2.1.4.2 Clear the BoardThis function clears the board of the selected letters.
3.2.1.4.3 Help
This function displays the rules of the game.
3.2.1.4.4 View Submitted Words
This function displays the words that have beensubmitted and that were in the dictionary.
3.2.1.4.5 Finish Game
This function ends the current game and takes theuser to the main menu of the game. The function uses
the calculate score function then displays the score ofthe game. It ends the new game activity.
3.2.1.4.5.1 Calculate Score
This function calculates the final score of the
game. It does this by counting the number of
letter in the submitted words data object.
3.2.1.5 High Score
When a game is finished and the score is calculated, the score is
compared to the high score. The higher score is then stored on thephone. The high score is displayed on the main screen of the game.
3.2.1.6 Exit Game
This function exits the games main menu back to the game suites
main menu.
3.2.2 Software Interface DescriptionWord search 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. The game also interfaces with Google web dictionarysearch, but it is not seen.
3.2.2.1 External machine interfacesThe 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.
7
-
7/31/2019 Android Req
8/34
3.2.2.2 External system interfaces
To play the game, the user must be connected to the internet eitherthrough 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. Theinterface 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 descriptionThe 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 itssubsections.
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 eventhappens.
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.
3.3.1.1.6 Word is misspelled
Selected letters are cleared then the screen shakes.
8
-
7/31/2019 Android Req
9/34
3.3.1.1.7 Letters are in Correct Positions
Word is appended to the submitted word data object
then the selected letters are cleared. Letters can onlybe played if they touch the next letter in the vertical,
horizontal, or diagonal direction.
3.3.1.1.8 Letters are not in Correct Positions
Selected letters are cleared then the screen shakes.
3.3.1.1.9 Help Button Pressed
The rules are shown in a dialog box.
3.3.1.1.10 View Submitted Button Pressed
The correctly submitted words are shown in a dialog
box.
3.3.1.1.11 Clear Selected Button PressedSelected letters are cleared from the screen.
3.3.1.1.12 Finished Button Pressed
Game is returned to the games home screen and the
score is calculated and shown.
3.3.1.1.13 No High Score is found
A default zero is displayed on the games home
screen.
3.3.1.1.14 High Score is found
The highest score is displayed on the games homescreen.
3.3.1.2 States
3.3.1.2.1 Main Menu
The main menu is displayed with the buttons for a new
game and exit.
3.3.1.2.2 Select Letter
The board is displayed where a user can select one or
multiple letters.
3.3.1.2.3 In Game Menu
A menu is displayed that gives the option to submit aword, clear the selection, view submitted, show help,
finish game, or go back to select a letter.
3.3.1.2.3 Submit Word
9
-
7/31/2019 Android Req
10/34
Word goes through checks to see if it is a word and in
the right position. Word will light up or the screen will
shake. Returns to the select a letter screen with theselection cleared.
3.3.1.2.4 Clear SelectionThe board will be cleared of the selected and return to
select a letter.
3.3.1.2.5 View Submitted
A dialog box will show the correctly submitted words.
3.3.1.2.6 Show Help
A dialog box will show the rules of the game.
3.3.1.2.7 Finish game
The game will end a show a dialog box with the score.It will return to the main menu.
3.3.1.2.8 Display Score 0
When a score is not found then a default zero is
displayed.
3.3.1.2.9 Display High Score
Retrieves and displays high score from memory.
3.3.1.2.10 Shakes Screen
Shifts screen by using an offset to appear to be
shaking.
3.3.1.2.11 Highlights Letters
Turns letters gold when the word is not misspelled andletters are in correct positions.
3.3.1.2.12 Highlight Letter
Turns the selected box a different color.
3.3.2 State Transition Diagrams
10
-
7/31/2019 Android Req
11/34
Figure four: Word Search State Diagram
4.0 Connect Four
4.1 Data DescriptionThe Connect Four game keeps track of data such as current players turn, current
locations of chips in the board, and end game scenarios.
4.1.1 Data objects
The first data object is the user. Users will take turns selecting columns onthe board in which to drop their chips. The board will be a seven by six
array of slots. As each user selects columns to place their chips there
locations on the board will be recorded to the array.
At the end of each game when a player has achieved four of their chips in
a row the number of wins for their color will be increased by one and storedlocally.
4.1.2 Relationships
The relationships between the data objects above can be seen in the figurebelow. The user will submit data and the program will pass around that data.
11
-
7/31/2019 Android Req
12/34
4.1.3 Data dictionary
If the game is closed at the end of a round or before any player places a chipwhen 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 emptyboard 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 runsfunctions to watch the user actions and act accordingly.
4.2.1.3.1 Placing a Chip
This function is supported by the androidonclicklistener. 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 thatplayer 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.
4.2.1.4.2 Help
This function displays the rules of the game.
12
-
7/31/2019 Android Req
13/34
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 theuser 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 theapplication is restarted.
4.2.2 Software Interface Description
Connect Four uses one interface that the user can see. The one that they seeis through the cell phone. The cell phone must be running the Android
operating system.
4.2.2.1 External machine interfacesThe game will run on two different machines. One is an emulator of
a cell phone that is used for development and testing. The other isthe users cell phone that hosts the game. The game must be
compatible with the Android operating system.
4.2.2.3 Human interfaceThis 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 buttonsand text so the user can understand what is going on.
4.2.3 Control flow descriptionThe 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 tothat users color. This is done until another event
happens.
4.3.1.1.3 Menu Button Pressed
13
-
7/31/2019 Android Req
14/34
When the phones menu button is pressed a menu
pops up.
4.3.1.1.4 Column is full
The screen shakes and the player is allowed to select
another column.
4.3.1.1.5 All Columns are full
The game ends and a new one begins with anempty board.
4.3.1.1.6 Player Gets Four in a Row
The score tally for the winning color is increased and anew game begins.
4.3.1.1.7 Help Button Pressed
The rules are shown in a dialog box.
4.3.1.1.8 Exit Button Pressed
Game is returned to the games home screen and the
score is calculated and shown.
4.3.1.1.9 View Wins Button is pressed
The total number of wins for each color is displayed.
4.3.1.2 States
4.3.1.2.1 Main Menu
The main menu is displayed with the buttons for a new
game and exit as well as the number of wins.
4.3.1.2.2 Select Column
The board is displayed where a user can select acolumn to place their chip. The game checks to see if
the newly placed chip makes the player a winner.
4.3.1.2.3 In Game Menu
A menu is displayed that gives the option to start a
new game, view wins, show help, end game, or go
back to continue game.
4.3.1.2.6 Show Help
A dialog box will show the rules of the game.
4.3.1.2.7 Exit game
14
-
7/31/2019 Android Req
15/34
The game will end a show a dialog box with the wins.
It will store any currently placed chips and return to the
main menu.
4.3.1.2.8 Display Wins 0
When a score is not found then a default zero isdisplayed.
4.3.1.2.9 Display Wins
Retrieves and displays wins from memory.
4.3.1.2.10 Shakes Screen
Shifts screen by using an offset to appear to beshaking.
4.3.2 State Transition Diagrams
15
-
7/31/2019 Android Req
16/34
Figure five: Connect Four Data Model
5.0 Battle Ship
5.1 Data Description
The game battleship utilizes integer arrays to store locations of ships and movesplayed. There are also Strings that contain such things as high score tables and other
user-related information.
5.1.1 Data objects
The first integer array contains a list of ship placements made when the
game first begins. The second array contains a list of moves made. Bycomparing the two, a 22x11 grid can be displayed. The top 11 coordinates
displaying moves already played, the bottom 11 displaying the players
remaining ships.
5.1.2 RelationshipsThe data relationships can be seen in the graph below. The first two arrays
are made independently through game progression. The Game Board is thencomputed by comparing the two.
5.1.3 Complete data modelFigure six: Battle Ship Complete Data Model
5.2 Functional Model and Description5.2.1 Description for Functions
5.2.1.1 New Game
When this function is initialized it sets up the data objects for
the game. It allows for the user to customize their shipplacements and randomizes a ship placement for the
computer. It then generates the grid to be displayed.
16
-
7/31/2019 Android Req
17/34
5.2.1.2 Make Move
Once the board is set up, the user is prompted to make a
move. After a move is made, it is compared to the dataarrays to check for hits, misses, repeats, etc. The process is
then randomly repeated for the computer.
5.2.1.2 Game Over
This function is called when the game recognizes that either
the user or computer as hit every coordinate of the opposingship placements. It will record a high score and prompt the
user to play again.
5.2.2 Software Interface DescriptionThe software interface is the same as the previous programs. It requires a
touch screen, Android-run device capable of internet connection.
5.2.3 Control flow descriptionThe control of the game jumps between the user and the computer as
moves are made. It begins when the game is initialized and ships are placed andends when a player has won.
5.3 Behavioral Model and Description
5.3.1 Description for software behavior5.3.1.1 Events
5.3.1.1.1 New Game (Place Ships)
A Difficulty is selected and ships are placed by theUser and Computer. A Game Board is this created.
5.3.1.1.2 Perform Move
The User is prompted to make a move. The move is
then compared against the existing data. The
computer follows in turn and the user is promptedagain.
5.3.1.1.3 Game Over
When the game senses that no enemy ships remain,then the game is over. The Player is then prompted to
play again. Yes takes the player back to the New
Game event; No takes the user back to the MainMenu.
5.3.1.2 States
5.3.1.2.1 Main Menu
The user has the option to set the difficulty of the
game, view high scores, and start a new game.
17
-
7/31/2019 Android Req
18/34
5.3.1.2.2 Playing Game
The User and Computer alternate performing moves
until someone wins or the game is prematurely ended.
5.3.2 State Transition Diagrams
Figure seven: Battle Ship State Diagram
6.0 Word Guesser6.1 Data DescriptionThe word guessers utilizes a few different data objects each of which are uses for
passes data around the program and keeping track of information. The data keepstrack of the correct answer to the word guess as well as each individual character
within the answer, each individual word also tracking each individual character
within each guess, as well as the number of individual guesses.
6.1.1 Data objects
The first data object is the new game. Once the word guess application is
selected from the home screen a new game is initiated with an answer, aguess count, a guess array and a Boolean correctness field. Each element of
the guess array is a character array so that each letter of each guess can be
compared to the correct answer. There will be a button at the bottom of theUI which will allow the user at any point within the running of the program
to create a new game, at which time the previous game will be overwritten.
18
-
7/31/2019 Android Req
19/34
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 anEdit 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 beignored, 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. Thescore 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 RelationshipsThe 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
Figure eight: Word Guesser Complete Data Model
6.1.4 Data dictionary
19
-
7/31/2019 Android Req
20/34
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 onthe 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 ispressed from the menu of word guesser. Once the button is pressed,
a new answer is selected from the word dictionary, the guess array isreinitiated 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 andreturns 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). Thisguess 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 answer of
the game which is generated from the word dictionary.
20
-
7/31/2019 Android Req
21/34
6.2.1.3.3 Compare Function
Once the correct answer and the individual guess aresubmitted, those two character arrays are passed to the
compare function to determine the correctness of the guess.
Each character within the guess array is first compared withthe character in the corresponding position of the answer
array. If those two characters are alike then the setColor()
function is called and the character is printed red. If thosetwo characters are not alike the guess array character is then
compared to every other character within the answer array. If
that character is found in the answer array then the setColor()
function is called and the character is printed yellow signifying that the character is in the answer, but not in the
correct position. If the character from the guess array is not
found in the answer array then the character is left as is.
6.2.1.3.4 Set Color Function
This function is called within the compare function. Theguess character array, an index identifying which element of
the array is being manipulated and integer value signifying
which color to set the text to be passed to the function. Thereturn value of the function is void.
6.2.1.4 Menu Functions
During the game the user can press the menu button to bring upoptions. The menu option is used to optimize screen space, avoiding
clutter.
6.2.1.4.1 Help
This function displays the rules of the game.
6.2.1.4.2 New Game
This function ends the current game and resets all data to
default values within the word guess game screen. All
previous data, other than the word dictionary, are destroyed.Selecting this option will nullify the possibility to store the
game score.
6.2.1.4.3 View High Score
This function displays the current high score for the word
guess game as well as the score of the current game forcomparison.
6.2.1.4.4 Finish Game
21
-
7/31/2019 Android Req
22/34
This function is very similar to the New Game function;
however, rather than taking the user back to the word guess
game screen, the user is returned back to the game suitehome screen as well as the final score being calculated and
submitted to the system. It ends the new game activity.
6.2.1.4.4.1 Calculate Score
This function calculates the final score of the game. It
does this by counting the total number of correctanswers without ending the game multiplied by 1000
and subtracting the total number of guesses
multiplied by 50.
6.2.1.4.4.2 High Score
When a game is finished, either by the user
incorrectly guessing six consecutive times or by
selecting finish game in the menu, the score iscalculated and compared to the current high score.
The higher of the two scores is stored onto the phoneand displayed in the high score option of the menu.
3.2.1.5 Exit Game
This function exits the word guesser game screen and returns back to
the game suite's main menu.
6.2.2 Software Interface DescriptionWord guesser uses on interface that the user can see. The one that they can
see is through the cell phone. The cell phone must be running the Android
OS.
6.2.2.1 External machine interfaces
The game will run on two different machines. One is an emulator ofa cell phone running the Android OS which will be used for
development and testing. The other is the user's cell phone that hosts
the game. The game must be compatible with the Android OS.
6.2.2.2 External system interfacesThere are no external system interfaces for the word guess game.
6.2.2.3 Human interfaceThis is the main interface that the user will interact with. The
interfaces will allow the user to use the phone's touch screen servicesand analog buttons. This interface is clear and easy to use. It shows
buttons and text so the user can understand what is going on within
the application.
22
-
7/31/2019 Android Req
23/34
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. Thiscontinues 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 behavior6.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 fieldis 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 theprevious guess was incorrect in syntax.
6.3.1.1.5 Character Not Found
The specific character in guess is printed to the screen in thedefault 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.
6.3.1.1.10 New Game Button Pressed
23
-
7/31/2019 Android Req
24/34
The current game will be destroyed and a new game will be
initiated. The score of the current game will not be calculated
or compared to the high score.
6.3.1.1.11 Finish Game Button Pressed
The score of the current game is calculated and displayed tothe user. It is then compared to the current high score and if
greater, the user is prompted that they just set a new high
score. Game is then returned to the game suite's home screen.
6.3.1.1.12 No High Score Found
A default zero is displayed when user selects View High
Score from the menu.
6.3.1.1.13 High Score Found
The highest score is splayed when the user selects View High
Score from the menu.
6.3.1.2 States
6.3.1.2.1 Main Menu
The main menu is displayed with the buttons for a new game
and exit.
6.3.1.2.2 Enter Guess
The Edit Text View is displayed where a user can input a
word as a guess. The word must be six letters in length.
6.3.1.2.3 In Game Menu
A menu in displayed that gives the option to view the highscores, start a new game, finish the current game, or show
help.
6.3.1.2.4 Submit Guess
Word Guesser checks the guess for validity then compares
guess to the answer to determine which characters are
correct.
6.3.1.2.5 New Game
A cleared game screen is displayed and all game data is set todefault.
6.3.1.2.6 Finish Game
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.
24
-
7/31/2019 Android Req
25/34
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 whenthe View High Score button is pressed.
6.3.1.2.10 Highlights Letter
Turns character RED when the letter is in the answer and inthe correct position. Turns character YELLOW when the
letter is in the array but in an incorrect position.
6.3.2 State Transition Diagrams
25
-
7/31/2019 Android Req
26/34
Figure nine: Word Guesser State Diagram
7.0 Sudoku
7.1 Data DescriptionThe 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 ofnumbers, 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 anumber 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 hintfunction, which calculated the used numbers. The hint function also colors
tiles according to how many numbers can go into the tile.
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 RelationshipsThe 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
Figure ten: Sudoku Complete Data Model
7.1.4 Data dictionary
All the data is stores locally and erased when a game is ended. When agame is started the game board is loaded and all the data is stored in local
variables. When the game is over or ended the local data is erased.
7.2 Functional Model and Description
7.2.1 Description for Functions7.2.1.1 Startup
26
-
7/31/2019 Android Req
27/34
This function is initiated when the Sudoku button is
pressed from the home screen. The function starts a new
activity that shows the main menu for the game.
7.2.1.2 Main Menu
This function shows the main menu with buttons for a new game,one for an exit, and one for an about page. There is also a menu
function to show the settings.
7.2.1.2.1 About
This function initiates a dialog box that pops up. It shows
information about Sudoku game and rules of the game.
7.2.1.2.2 Settings
This function pops up a menu with various settings for the
Sudoku game. The settings are stored locally and are erased
after the game is exited.
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 takesthe 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 puzzleand 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 objectand passes it to the main game function to be drawn.
7.2.1.4 Main Game
27
-
7/31/2019 Android Req
28/34
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. Thisfunction is run all the numbers are filled or the game is exited.
7.2.1.4.1 Draw BoardEvery 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. Itthen calls the hints function and brings up the select numbers
function.
7.2.1.4.3 Select NumbersThis function brings up a dialog box that shows the available
numbers to select for that tile. Once the number is selected itsends it to the main game function to get drawn.
7.2.1.4.4 Hints
This function goes through the board and finds the available
numbers for each tile. It uses the amount of numbers
available to pick a color for that tile.
7.2.1.4.5 End Game
This function ends the current game and goes to the main
menu of Sudoku.
7.2.2 Software Interface DescriptionSudoku uses one interface that the user can see. The one that they see isthrough the cell phone. The cell phone must be running the Android
operating system.
7.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 becompatible with the Android operating system.
7.2.2.2 External system interfacesThe game does not use any external interfaces. All components of
the game are internal.
7.2.2.3 Human interface
28
-
7/31/2019 Android Req
29/34
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 buttonsand text so the user can understand what is going on.
7.2.3 Control flow descriptionThe 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 itssubsections.
7.3 Behavioral Model and Description
7.3.1 Description for software behavior7.3.1.1 Events
7.3.1.1.1 New Game Button Pressed
A new game is started, puzzle drawn, and board is drawn.
7.3.1.1.2 About Button Pressed
Shows the rules and information of the game.
7.3.1.1.3 Exit Button Pressed
Exits the game to the games main menu.
7.3.1.1.4 Menu Pressed
A menu pops of with the settings button.
7.3.1.1.5 Setting Button Pressed
A new page is shown with settings of the game to be set.
7.3.1.1.6 Hints Option Button Pressed
This event turns on and off the hints function of the game.
7.3.1.1.7 Music Option Button Pressed
The event turns on and off the music of the game.
7.3.1.1.8 Difficulty Selected
When the new game is selected the user is presented with an
option to select the difficulty of the game. The option is then
passed to the game.
7.3.1.1.9 Tile Selected
When inside the main game the user will select tiles to put orchange a number in. When a tile is selected it brings up a
menu to pick what number goes inside the square.
7.3.1.1.10 Draw Board
29
-
7/31/2019 Android Req
30/34
This event is called at the beginning of the game and after a
new number is selected.
7.3.1.2 States7.3.1.2.1 Main Menu
The main menu is selected when the Sudoku game isselected. It has buttons for a new game, about page, exit, and
a menu.
7.3.1.2.2 About
The about page is a dialog box that shows the rules of the
game.
7.3.1.2.3 Exit
This exits the game to the main menu of the game suite.
7.3.1.2.4 MenuThis 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 forthe 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 thedifficulty of the game.
7.3.1.2.9 Tile Select
This is the main page of the game to be displayed. It showsthe 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 eachavailable number.
7.3.2 State Transition Diagrams
30
-
7/31/2019 Android Req
31/34
Figure eleven: Sudoku State Diagram
8.0 Restrictions, Limitations, and Constraints
The application is being developed for the Android operating system and as such should be
compatible with at least the majority of the current versions of Android which are 1.1, 1.5,
1.6, 2.0, and 2.0.1. The application must be designed to display correctly on the wide rangeof mobile phones which run the Android operating system. The overall application and its
individual parts must be designed to run smoothly and quickly on the relatively limited
processing power of mobile devises.
9.0 Validation Criteria
Validation for the application will mostly be focused around the end user use case. Whilenot all possible scenarios can be tested validation will consist of testing a reasonable
number of cases to declare that all cases should work.
9.1 Classes of tests
9.1.1 Welcome Screen
31
-
7/31/2019 Android Req
32/34
- 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 connecthorizontally, vertically, diagonally.
- Game should open and close cleanly and game state should be restored if
the application was closed mid game.
32
-
7/31/2019 Android Req
33/34
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 shipshave 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 theyare. 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 bepersistent when re-launching.
9.2.6 Sudoku
- Individual entries should be registered on the board and the game shouldend when the puzzle has been solved.
- Game should open and close cleanly and high score should bepersistent when re-launching.
9.3 Performance bounds
All games and their individual subsystems should run smoothly and quickly.
10.0 Appendices
10.1 Product StrategiesOur 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.
33
-
7/31/2019 Android Req
34/34
Figure twelve: Android OS Emulator