You are on page 1of 35

Android Game Suite

CS 430 Requirements Specification February 14th, 2010


Benjamin Carpenter Ryan Daugherty Jack Dehlin Jay Greene

ab!e of Contents 4.0 Connect Four................................................................................................................11

1.0 Introduction This document specifies the requirements for the production and design of the Game Suite software for the Google Android operating s stem. The product will !e a suite of fi"e simple and eas games for a user to pla . The games include a word search# connect four# !attle ship# hangman# and a Sudo$u. The first four games will !e uniquel de"eloped and the fifth will use an open source Sudo$u. The user interface will !e eas to use and allow the user to go in%!etween games with ease. &t will use the cell phone operating s stem Android# which is on a lot of cell phones toda . The android operating s stem uses a mar$et place to sell applications for the phone. 1.1 Goals and objectives The goal of this pro'ect is to produce an interacti"e and entertaining application for the Android mar$etplace. This app will !e a suite of se"eral smaller games# one of which is open source# the rest custom made. The will !e pla a!le on an phone supporting the android operating s stem with access to the internet. 1.2 Statement of scope The onl input to this pro'ect is the user(s attention and strategic mo"es) and the onl output is the entertainment that is a consequence of the input. 1.3 Software context The !ig picture of this pro'ect will !e to pro"ide entertainment for an one with access to an Android de"ice. 1.4 Major constraints Since this pro'ect can easil !e !ro$en down into man smaller functioning parts# there are few ma'or constraints. As long as the Android *ar$etplace is up and running and people are still using the Android +S# it will !e possi!le to mar$et# maintain# and operate this application. 2.0 sa!e scenario 2.1 ser profiles ,sers of the s stem will !e an one who has a mo!ile de"ice operating the Android +S with access to the Android *ar$etplace. The application will !e accessi!le to e"er one ! these means and require onl na"igation of the menus and games through the touch%screen interface. 2.2 se"cases Figures one and two show the different use cases for the game suite. Figure one show the interaction !etween the user and the Android +S. Figure two show the interaction !etween the user and the main menu.

#i!ure $ne% se &ase 'ia!ram for interaction wit( t(e user and t(e )ndroid $S

#i!ure *wo% se &ase 'ia!ram for interaction wit( t(e user and t(e main menu

3.0 +ord Searc( 3.1 'ata 'escription The word search utili.es a couple of different data o!'ects. These o!'ects are used for passing data around and $eeping trac$ of information. The data $eeps trac$ of selected letters# selected words# and game scores. 4

3.1.1 'ata objects The first data o!'ect is the user. The user will select letters to ma$e words for the word search. The letter themsel"es are characters. *ultiple selected letters are formed to ma$e a string. +nce the user is content with the selected word# it can !e su!mitted to chec$ if it is actuall a word. The second data o!'ect is the collection of selected words. These words are stored in the form of a string and an arra of tiles. &f the su!mitted word is correct it is appended to the collection of selected words. &f it is wrong then the word is discarded. The third data o!'ect is the final score when the game is ended. The score is calculated ! counting the num!er of letters su!mitted in the selected words. The game will locall $eep the highest score for displa . 3.1.2 ,elations(ips The relationships !etween the data o!'ects a!o"e can !e seen in the figure !elow. The user will su!mit data and the program will pass around that data. 3.1.3 &omplete data model

#i!ure t(ree% +ord Searc( &omplete 'ata Model

3.1.4 'ata dictionarAll the data e/cept for the high score is onl stored when it is running. +nce the program is ended all data will !e discarded. The high score will !e stored on the phones memor and shown at the startup screen. 3.2 #unctional Model and 'escription 3.2.1 'escription for #unctions 3.2.1.1 Startup

This function is initiated when the word search game is pressed from the home screen. The function starts a new acti"it that shows the main menu for the game. 3.2.1.2 .ew Game This function is initiated at the initial screen when the new game !utton is pressed. After the !utton is pressed# it creates a random pu..le# draws the !oard# then passes of the responsi!ilit to the main game function. 3.2.1.2.1 &reate ,andom /u00le 1hen a new game is started# this function randoml pic$s 21 num!ers. The range of the num!ers is 0 to 20 and is then con"erted to character to represent a letter. The letters are then stored in an arra . 3.2.1.3 Main Game #unction After a new game is started# the main game function runs functions to watch the user actions and act accordingl . 3.2.1.3.1 'raw t(e 1oard 3"er time an action or function is called the !oard is redrawn to show the changes. The function draws a 4/4 !oard with the letters inserted into each position. The function loo$s at an arra to see which words were alread correctl selected. These words are drawn a different color. 3.2.1.3.2 Select 2etters This function is supported ! the android onclic$listener. 1hen a user selects a letter# it records it in an arra . &t $eeps trac$ of the order that the user presses the letters in. 3.2.1.4 Menu #unctions 5uring the game the user can press the menu !utton to !ring up options. The menu option is used to conser"e space on the screen. 3.2.1.4.1 Submit a +ord After letters are selected the user can su!mit the word to see if it is a correct word. The function calls dictionar chec$ and gets the result. &f it is a word# then the word is added to the su!mitted word data o!'ect. &f it is not a word# then the screen sha$es. After the word functions are done# the selected is cleared with the clear function. 6

3.2.1.4.1.1 'ictionar- &(ec3 1hen a word is passed into this function it uses the Google online dictionar search. &t gets the source page of the search and parses it to see if the word is in the dictionar . &t returns the result. 3.2.1.4.2 &lear t(e 1oard This function clears the !oard of the selected letters. 3.2.1.4.3 4elp This function displa s the rules of the game. 3.2.1.4.4 5iew Submitted +ords This function displa s the words that ha"e !een su!mitted and that were in the dictionar . 3.2.1.4.6 #inis( Game This function ends the current game and ta$es the user to the main menu of the game. The function uses the calculate score function then displa s the score of the game. &t ends the new game acti"it . 3.2.1.4.6.1 &alculate Score This function calculates the final score of the game. &t does this ! counting the num!er of letter in the su!mitted words data o!'ect. 3.2.1.6 4i!( Score 1hen a game is finished and the score is calculated# the score is compared to the high score. The higher score is then stored on the phone. The high score is displa ed on the main screen of the game. 3.2.1.7 8xit Game This function e/its the game7s main menu !ac$ to the game suite7s main menu. 3.2.2 Software Interface 'escription 1ord search uses one interface that the user can see. The one that the see is through the cell phone. The cell phone must !e running the Android operating s stem. The game also interfaces with Google we! dictionar search# !ut it is not seen. 3.2.2.1 8xternal mac(ine interfaces The game will run on two different machines. +ne is an emulator of a cell phone that is used for de"elopment and testing. The other 8

is the user7s cell phone that hosts the game. The game must !e compati!le with the Android operating s stem. 3.2.2.2 8xternal s-stem interfaces To pla the game# the user must !e connected to the internet either through the phone7s data networ$ or 1i%Fi. The Google we! dictionar search is to chec$ to ma$e sure the word e/ists and is not seen ! the user. 3.2.2.3 4uman interface This is the main interface that the user will interact with. The interface will allow the user to use the phones touch screen ser"ices and analog !uttons. This interface is clear and eas to use. &t shows !uttons and te/t so the user can understand what is going on. 3.2.3 &ontrol 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 !e different states of the game. This continues till the game is finished. This descri!ed in section 0.0 and its su!sections. 3.3 1e(avioral Model and 'escription 3.3.1 'escription for software be(avior 3.3.1.1 8vents 3.3.1.1.1 .ew Game 1utton /ressed A new game is started# pu..le made# !oard is drawn. 3.3.1.1.2 2etter Selected 1hen the user touches a !o/# the !o/ is documented. After it is documented then the !oard is redrawn with the !o/ highlighted. This is done till another e"ent happens. 3.3.1.1.3 Menu 1utton /ressed 1hen the phone7s menu !utton is pressed a menu pops up. 3.3.1.1.4 Submit 1utton /ressed 1hen the su!mit !utton is pressed the word is chec$ed to see if it is misspelled or not positioned right. 3.3.1.1.6 +ord is not misspelled 1ord is chec$ed to see if the are in correct positions.

3.3.1.1.7 +ord is misspelled Selected letters are cleared then the screen sha$es. 3.3.1.1.9 2etters are in &orrect /ositions 1ord is appended to the su!mitted word data o!'ect then the selected letters are cleared. 9etters can onl !e pla ed if the touch the ne/t letter in the "ertical# hori.ontal# or diagonal direction. 3.3.1.1.: 2etters are not in &orrect /ositions Selected letters are cleared then the screen sha$es. 3.3.1.1.; 4elp 1utton /ressed The rules are shown in a dialog !o/. 3.3.1.1.10 5iew Submitted 1utton /ressed The correctl su!mitted words are shown in a dialog !o/. 3.3.1.1.11 &lear Selected 1utton /ressed Selected letters are cleared from the screen. 3.3.1.1.12 #inis(ed 1utton /ressed Game is returned to the game7s home screen and the score is calculated and shown. 3.3.1.1.13 .o 4i!( Score is found A default .ero is displa ed on the game7s home screen. 3.3.1.1.14 4i!( Score is found The highest score is displa ed on the game7s home screen. 3.3.1.2 States 3.3.1.2.1 Main Menu The main menu is displa ed with the !uttons for a new game and e/it. 3.3.1.2.2 Select 2etter The !oard is displa ed where a user can select one or multiple letters. 3.3.1.2.3 In Game Menu

A menu is displa ed that gi"es the option to su!mit a word# clear the selection# "iew su!mitted# show help# finish game# or go !ac$ to select a letter. 3.3.1.2.3 Submit +ord 1ord goes through chec$s to see if it is a word and in the right position. 1ord will light up or the screen will sha$e. :eturns to the select a letter screen with the selection cleared. 3.3.1.2.4 &lear Selection The !oard will !e cleared of the selected and return to select a letter. 3.3.1.2.6 5iew Submitted A dialog !o/ will show the correctl su!mitted words. 3.3.1.2.7 S(ow 4elp A dialog !o/ will show the rules of the game. 3.3.1.2.9 #inis( !ame The game will end a show a dialog !o/ with the score. &t will return to the main menu. 3.3.1.2.: 'ispla- Score 0 1hen a score is not found then a default .ero is displa ed. 3.3.1.2.; 'ispla- 4i!( Score :etrie"es and displa s high score from memor . 3.3.1.2.10 S(a3es Screen Shifts screen ! using an offset to appear to !e sha$ing. 3.3.1.2.11 4i!(li!(ts 2etters Turns letters gold when the word is not misspelled and letters are in correct positions. 3.3.1.2.12 4i!(li!(t 2etter Turns the selected !o/ a different color. 3.3.2 State *ransition 'ia!rams

10

#i!ure four% +ord Searc( State 'ia!ram

4.0 &onnect #our 4.1 'ata 'escription The Connect Four game $eeps trac$ of data such as current pla ers turn# current locations of chips in the !oard# and end game scenarios. 4.1.1 'ata objects The first data o!'ect is the user. ,sers will ta$e turns selecting columns on the !oard in which to drop their chips. The !oard will !e a se"en ! si/ arra of slots. As each user selects columns to place their chips there locations on the !oard will !e recorded to the arra . At the end of each game when a pla er has achie"ed four of their chips in a row the num!er of wins for their color will !e increased ! one and stored locall . 4.1.2 ,elations(ips

11

The relationships !etween the data o!'ects a!o"e can !e seen in the figure !elow. The user will su!mit data and the program will pass around that data. 4.1.3 'ata dictionar&f the game is closed at the end of a round or !efore an pla er places a chip when a new game is started then no data is stored other than the tall of wins. &f the game is closed mid round then the state of the !oard is stored locall and reinitiali.ed upon re%launching the application. 4.2 #unctional Model and 'escription 4.2.1 'escription for #unctions 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 acti"it that shows the main menu for the game. 4.2.1.2 .ew Game This function is initiated at the initial screen when the new game !utton is pressed. After the !utton is pressed# it creates an empt !oard of se"en ! si/# draws the !oard# then passes off the responsi!ilit to the main game function. 4.2.1.3 Main Game #unction After a new game is started# the main game function runs functions to watch the user actions and act accordingl . 4.2.1.3.1 /lacin! a &(ip This function is supported ! the android onclic$listener. 1hen a pla er selects a column to place their chip the lowest empt space in that column is changed to their color. 4.2.1.3.2 &(ec3 for 5ictor3ach time a chip is placed the game will chec$ if that pla er has won ! tr ing to find three ad'acent chips of their color in an direction. 4.2.1.4 Menu #unctions 5uring the game the user can press the menu !utton to !ring up options. The menu option is used to conser"e space on the screen. 4.2.1.4.1 .ew Game This function clears the !oard and !egins a new game.

12

4.2.1.4.2 4elp This function displa s the rules of the game. 4.2.1.4.4 5iew +ins This function displa s the total num!er of wins for each color# !lac$ and red. 4.2.1.4.6 8xit This function ends the current game and ta$es the user to the main menu of the game. &f an chips ha"e !een placed on the !oard the locations of those chips is stored on the de"ise and reloaded once the application is restarted. 4.2.2 Software Interface 'escription Connect Four uses one interface that the user can see. The one that the see is through the cell phone. The cell phone must !e running the Android operating s stem. 4.2.2.1 8xternal mac(ine interfaces The game will run on two different machines. +ne is an emulator of a cell phone that is used for de"elopment and testing. The other is the user7s cell phone that hosts the game. The game must !e compati!le with the Android operating s stem. 4.2.2.3 4uman interface This is the main interface that the user will interact with. The interface will allow the user to use the phones touch screen ser"ices and analog !uttons. This interface is clear and eas to use. &t shows !uttons and te/t so the user can understand what is going on. 4.2.3 &ontrol 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 !e different states of the game. This continues till the game is finished. 4.3 1e(avioral Model and 'escription 4.3.1 'escription for software be(avior 4.3.1.1 8vents 4.3.1.1.1 .ew Game 1utton /ressed A new game is started# empt !oard is drawn. 4.3.1.1.2 &olumn Selected 1hen the user touches a !o/ at the top of a column the lowest empt space in that column is switched to 1-

that users color. This is done until another e"ent happens. 4.3.1.1.3 Menu 1utton /ressed 1hen the phone7s menu !utton is pressed a menu pops up. 4.3.1.1.4 &olumn is full The screen sha$es and the pla er is allowed to select another column. 4.3.1.1.6 )ll &olumns are full The game ends and a new one !egins with an empt !oard. 4.3.1.1.7 /la-er Gets #our in a ,ow The score tall for the winning color is increased and a new game !egins. 4.3.1.1.9 4elp 1utton /ressed The rules are shown in a dialog !o/. 4.3.1.1.: 8xit 1utton /ressed Game is returned to the game7s home screen and the score is calculated and shown. 4.3.1.1.; 5iew +ins 1utton is pressed The total num!er of wins for each color is displa ed. 4.3.1.2 States 4.3.1.2.1 Main Menu The main menu is displa ed with the !uttons for a new game and e/it as well as the num!er of wins. 4.3.1.2.2 Select &olumn The !oard is displa ed where a user can select a column to place their chip. The game chec$s to see if the newl placed chip ma$es the pla er a winner. 4.3.1.2.3 In Game Menu A menu is displa ed that gi"es the option to start a new game# "iew wins# show help# end game# or go !ac$ to continue game. 4.3.1.2.7 S(ow 4elp A dialog !o/ will show the rules of the game. 14

4.3.1.2.9 8xit !ame The game will end a show a dialog !o/ with the wins. &t will store an currentl placed chips and return to the main menu. 4.3.1.2.: 'ispla- +ins 0 1hen a score is not found then a default .ero is displa ed. 4.3.1.2.; 'ispla- +ins :etrie"es and displa s wins from memor . 4.3.1.2.10 S(a3es Screen Shifts screen ! using an offset to appear to !e sha$ing. 4.3.2 State *ransition 'ia!rams

10

#i!ure five% &onnect #our 'ata Model

6.0 1attle S(ip 6.1 'ata 'escription The game !attleship utili.es integer arra s to store locations of ships and mo"es pla ed. There are also Strings that contain such things as high score ta!les and other user%related information. 6.1.1 'ata objects The first integer arra contains a list of ship placements made when the game first !egins. The second arra contains a list of mo"es made. ; comparing the two# a 22/11 grid can !e displa ed. The top 11 coordinates displa ing mo"es alread pla ed# the !ottom 11 displa ing the pla ers remaining ships. 6.1.2 ,elations(ips The data relationships can !e seen in the graph !elow. The first two arra s are made independentl through game progression. The Game ;oard is then computed ! comparing the two. 6.1.3 &omplete data model
#i!ure six% 1attle S(ip &omplete 'ata Model

6.2 #unctional Model and 'escription 6.2.1 'escription for #unctions 6.2.1.1 .ew Game 1hen this function is initiali.ed it sets up the data o!'ects for the game. &t allows for the user to customi.e their ship placements and randomi.es a ship placement for the computer. &t then generates the grid to !e displa ed. 16

6.2.1.2 Ma3e Move +nce the !oard is set up# the user is prompted to ma$e a mo"e. After a mo"e is made# it is compared to the data arra s to chec$ for hits# misses# repeats# etc. The process is then randoml repeated for the computer. 6.2.1.2 Game $ver This function is called when the game recogni.es that either the user or computer as hit e"er coordinate of the opposing ship placements. &t will record a high score and prompt the user to pla again. 6.2.2 Software Interface 'escription The software interface is the same as the pre"ious programs. &t requires a touch screen# Android%run de"ice capa!le of internet connection. 6.2.3 &ontrol flow description The control of the game 'umps !etween the user and the computer as mo"es are made. &t !egins when the game is initiali.ed and ships are placed and ends when a pla er has won. 6.3 1e(avioral Model and 'escription 6.3.1 'escription for software be(avior 6.3.1.1 8vents 6.3.1.1.1 .ew Game </lace S(ips= A 5ifficult is selected and ships are placed ! the ,ser and Computer. A Game ;oard is this created. 6.3.1.1.2 /erform Move The ,ser is prompted to ma$e a mo"e. The mo"e is then compared against the e/isting data. The computer follows in turn and the user is prompted again. 6.3.1.1.3 Game $ver 1hen the game senses that no enem ships remain# then the game is o"er. The <la er is then prompted to pla again. =es ta$es the pla er !ac$ to the >ew Game e"ent) >o ta$es the user !ac$ to the *ain *enu. 6.3.1.2 States 6.3.1.2.1 Main Menu The user has the option to set the difficult of the game# "iew high scores# and start a new game.

18

6.3.1.2.2 /la-in! Game The ,ser and Computer alternate performing mo"es until someone wins or the game is prematurel ended. 6.3.2 State *ransition 'ia!rams

#i!ure seven% 1attle S(ip State 'ia!ram

7.0 +ord Guesser 7.1 'ata 'escription The word guessers utili.es a few different data o!'ects each of which are uses for passes data around the program and $eeping trac$ of information. The data $eeps trac$ of the correct answer to the word guess as well as each indi"idual character within the answer# each indi"idual word ? also trac$ing each indi"idual character within each guess# as well as the num!er of indi"idual guesses. 7.1.1 'ata objects The first data o!'ect is the new game. +nce the word guess application is selected from the home screen a new game is initiated with an answer# a guess count# a guess arra and a ;oolean correctness field. 3ach element of the guess arra is a character arra so that each letter of each guess can !e compared to the correct answer. There will !e a !utton at the !ottom of the ,& which will allow the user at an point within the running of the program to create a new game# at which time the pre"ious game will !e o"erwritten.

12

The ne/t data o!'ect is the answer. The answer will !e generated at the !eginning of each new game accessing a predefined list of si/ letter words. The answer will !e stored in an arra of characters. The third data o!'ect is the guess arra . The guess arra will consist of si/ elements each of which is a character arra . &t will !e generated from an 3dit Te/t field su!mitted ! the user. &f the guess is a "alid word @&.e. has si/ characters# and all characters are lettersA then the guess will !e con"erted to a character arra and added to the guess arra . +therwise the guess will !e ignored# the user will !e prompted of the mista$e and will !e a!le to su!mit another guess. The final data o!'ect will !e the final score when the game is ended. The score is calculated ! counting the num!er of words correctl answered !efore ending the game# multipl ing that num!er ! one thousand and su!tracting the num!er of guesses ta$en multiplied ! 00. The game will locall $eep the highest score for displa . 7.1.2 ,elations(ips The relationship !etween the data o!'ects a!o"e can !e seen in the following figure. The user will su!mit data and the program will process that information accordingl . 7.1.3 &omplete data model

#i!ure ei!(t% +ord Guesser &omplete 'ata Model

7.1.4 'ata dictionar14

All of the data e/cluding the word dictionar will !e stored on when the program itself is running. +nce the program is stopped# or a new game is initiated# all data will !e discarded. The word dictionar will !e stored on the phones memor and will !e accessed at each initiation of a new game# at which time a random word will !e selected as the answer for that particular game. 7.2 #unctional Model and 'escription 7.2.1 'escription for #unctions 7.2.1.1 Start p This function in initiated when the word guesser game is pressed from the home screen. The function starts a new acti"it that shows the main game screen for the word guesser. 7.2.1.2 .ew Game This function in initiated once the word guesser !utton is pressed from the game suite home screen and when the new game !utton is pressed from the menu of word guesser. +nce the !utton is pressed# a new answer is selected from the word dictionar # the guess arra is reinitiated to the default "alues# the guess count is reset to .ero and the correctness field is set to false. 7.2.1.2.1 )nswer Generator 1hen a new game is started# a random num!er !etween 0 and 600 is generated at which time the program tra"erses the word dictionar for the generated amount of interactions and returns that word as the correct answer for the game. 7.2.1.3 Main Game #unction After a new game is started# the main game function runs functions to watch the user actions and act accordingl . 7.2.1.3.1 Submit Guess #unction 3ach time the +B !utton located ad'acent to the 3dit Te/t field is selected a function is called to first chec$ the "alidit of the guess @i.e. current length and correct charactersA. This guess is first stored as a String) howe"er# will !e passed through the split@A function to create a character arra of the guess for comparison. 7.2.1.3.2 Split #unctional +nce the guess string is retrie"ed from the 3dit Te/t field# this function is called to create a character arra of the guess. A string is passed to the function and a character arra is returned. This function is also used for the correct

20

answer of the game which is generated from the word dictionar . 7.2.1.3.3 &ompare #unction +nce the correct answer and the indi"idual guess are su!mitted# those two character arra s are passed to the compare function to determine the correctness of the guess. 3ach character within the guess arra is first compared with the character in the corresponding position of the answer arra . &f those two characters are ali$e then the setColor@A function is called and the character is printed red. &f those two characters are not ali$e the guess arra character is then compared to e"er other character within the answer arra . &f that character is found in the answer arra then the setColor@A function is called and the character is printed ellow ? signif ing that the character is in the answer# !ut not in the correct position. &f the character from the guess arra is not found in the answer arra then the character is left as is. 7.2.1.3.4 Set &olor #unction This function is called within the compare function. The guess character arra # an inde/ identif ing which element of the arra is !eing manipulated and integer "alue signif ing which color to set the te/t to !e passed to the function. The return "alue of the function is "oid. 7.2.1.4 Menu #unctions 5uring the game the user can press the menu !utton to !ring up options. The menu option is used to optimi.e screen space# a"oiding clutter. 7.2.1.4.1 4elp This function displa s the rules of the game. 7.2.1.4.2 .ew Game This function ends the current game and resets all data to default "alues within the word guess game screen. All pre"ious data# other than the word dictionar # are destro ed. Selecting this option will nullif the possi!ilit to store the game score. 7.2.1.4.3 5iew 4i!( Score This function displa s the current high score for the word guess game as well as the score of the current game for comparison. 21

7.2.1.4.4 #inis( Game This function is "er similar to the >ew Game function) howe"er# rather than ta$ing the user !ac$ to the word guess game screen# the user is returned !ac$ to the game suite home screen as well as the final score !eing calculated and su!mitted to the s stem. &t ends the new game acti"it . 7.2.1.4.4.1 &alculate Score This function calculates the final score of the game. &t does this ! counting the total num!er of correct answers without ending the game multiplied ! 1000 and su!tracting the total num!er of guesses multiplied ! 00. 7.2.1.4.4.2 4i!( Score 1hen a game is finished# either ! the user incorrectl guessing si/ consecuti"e times or ! selecting finish game in the menu# the score is calculated and compared to the current high score. The higher of the two scores is stored onto the phone and displa ed in the high score option of the menu. 3.2.1.6 8xit Game This function e/its the word guesser game screen and returns !ac$ to the game suite(s main menu. 7.2.2 Software Interface 'escription 1ord guesser uses on interface that the user can see. The one that the can see is through the cell phone. The cell phone must !e running the Android +S. 7.2.2.1 8xternal mac(ine interfaces The game will run on two different machines. +ne is an emulator of a cell phone running the Android +S which will !e used for de"elopment and testing. The other is the user(s cell phone that hosts the game. The game must !e compati!le with the Android +S. 7.2.2.2 8xternal s-stem interfaces There are no e/ternal s stem interfaces for the word guess game. 7.2.2.3 4uman interface This is the main interface that the user will interact with. The interfaces will allow the user to use the phone(s touch screen ser"ices and analog !uttons. This interface is clear and eas to use. 22

&t shows !uttons and te/t so the user can understand what is going on within the application. 7.2.3 &ontrol 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 !e different states of the game. This continues till the game is finished. These indi"idual game states are descri!ed in section 6.2.-.2 and its su!sections. 7.3 1e(avioral Model and 'escription 7.3.1 'escription for software be(avior 7.3.1.1 8vents 7.3.1.1.1 .ew Game 1utton /resses A new game is started# answer fetched from the dictionar . 7.3.1.1.2 Menu 1utton /ressed 1hen the phone(s menu !utton is pressed a menu pops up. 7.3.1.1.3 $> 1utton /ressed 1hen the +B !utton is pressed the te/t in the 3dit Te/t field is retrie"ed and chec$ed for correctness. Then the guess is compared against the answer. 7.3.1.1.4 Guess is Invalid 3dit Te/t field is clears and the user is prompted that the pre"ious guess was incorrect in s nta/. 7.3.1.1.6 &(aracter .ot #ound The specific character in guess is printed to the screen in the default gre te/t and the guess count is incremented. 7.3.1.1.7 &(aracter #ound in &orrect /osition The specific character in the guess is printed in :35 to signif it is a correct letter and in the correct position. 7.3.1.1.9 &(aracter #ound in Incorrect /osition The specific character in the guess is printed in =399+1 to signif it is a correct letter) howe"er# in an incorrect position. 7.3.1.1.: 5iew 4i!( Score 1utton /ressed The high score of the game is displa ed to user as well as the score of the current game @if an A. 7.3.1.1.; 4elp 1utton /ressed The rules are displa ed in a dialog !o/. 2-

7.3.1.1.10 .ew Game 1utton /ressed The current game will !e destro ed and a new game will !e initiated. The score of the current game will not !e calculated or compared to the high score. 7.3.1.1.11 #inis( Game 1utton /ressed The score of the current game is calculated and displa ed to the user. &t is then compared to the current high score and if greater# the user is prompted that the 'ust set a new high score. Game is then returned to the game suite(s home screen. 7.3.1.1.12 .o 4i!( Score #ound A default .ero is displa ed when user selects Ciew Digh Score from the menu. 7.3.1.1.13 4i!( Score #ound The highest score is spla ed when the user selects Ciew Digh Score from the menu. 7.3.1.2 States 7.3.1.2.1 Main Menu The main menu is displa ed with the !uttons for a new game and e/it. 7.3.1.2.2 8nter Guess The 3dit Te/t Ciew is displa ed where a user can input a word as a guess. The word must !e si/ letters in length. 7.3.1.2.3 In Game Menu A menu in displa ed that gi"es the option to "iew the high scores# start a new game# finish the current game# or show help. 7.3.1.2.4 Submit Guess 1ord Guesser chec$s the guess for "alidit then compares guess to the answer to determine which characters are correct. 7.3.1.2.6 .ew Game A cleared game screen is displa ed and all game data is set to default. 7.3.1.2.7 #inis( Game

24

The game will end a show a dialog !o/ with the score as well as a congratulation if a new high score was set. &t will return to the game suite(s main menu. 7.3.1.2.9 S(ow 4elp A dialog !o/ will show the rules of the game. 7.3.1.2.: 'ispla- Score 0 1hen a score is not found then a default .ero is displa ed when the Ciew Digh Score !utton is pressed. 7.3.1.2.; 'ispla- 4i!( Score :etrie"es and displa ed the high score from memor when the Ciew Digh Score !utton is pressed. 7.3.1.2.10 4i!(li!(ts 2etter Turns character :35 when the letter is in the answer and in the correct position. Turns character =399+1 when the letter is in the arra !ut in an incorrect position. 7.3.2 State *ransition 'ia!rams

20

#i!ure nine% +ord Guesser State 'ia!ram

9.0 Sudo3u 9.1 'ata 'escription The word search utili.es a couple of different data o!'ects. These o!'ects are used for passing data around and $eeping trac$ of information. The data $eeps trac$ of num!ers# difficultl le"el# tiles# and hints. 9.1.1 'ata objects The first data o!'ect is the user. The user will select a tile to enter a num!er into. The user can select an of the tiles in the 4/4 !oard. +nce a tile is select a dialog !o/ will with the a"aila!le num!ers. The user will select a num!er and it will !e placed into the tile. The second data o!'ect is the hints. 1hen the tile selected dialog !o/ appears onl the a"aila!le num!ers appear. This is helped out ! the hint function# which calculated the used num!ers. The hint function also colors tiles according to how man num!ers can go into the tile. 26

The last data o!'ect is the difficult le"el. 1hen a new game is started# the user selects an eas # medium# or hard le"el. Then a !oard is drawn ! that difficult . 9.1.2 ,elations(ips The relationships !etween the data o!'ects a!o"e can !e seen in the figure !elow. The user will su!mit data and the program will pass around that data. 9.1.3 &omplete data model

#i!ure ten% Sudo3u &omplete 'ata Model

9.1.4 'ata dictionarAll the data is stores locall and erased when a game is ended. 1hen a game is started the game !oard is loaded and all the data is stored in local "aria!les. 1hen the game is o"er or ended the local data is erased. 9.2 #unctional Model and 'escription 9.2.1 'escription for #unctions 9.2.1.1 Startup This function is initiated when the Sudo$u !utton is pressed from the home screen. The function starts a new acti"it that shows the main menu for the game. 9.2.1.2 Main Menu This function shows the main menu with !uttons for a new game# one for an e/it# and one for an a!out page. There is also a menu function to show the settings. 9.2.1.2.1 )bout This function initiates a dialog !o/ that pops up. &t shows information a!out Sudo$u game and rules of the game. 9.2.1.2.2 Settin!s This function pops up a menu with "arious settings for the Sudo$u game. The settings are stored locall and are erased after the game is e/ited. 28

9.2.1.2.2.1 Music This function turns the music on and off. 9.2.1.2.2.2 4ints This function turns the hints on and off. 9.2.1.2.3 8xit This function e/its the main menu of the Sudo$u and ta$es the user !ac$ to the main menu of the game suite. 9.2.1.3 .ew Game This function is acti"ated when the new game !utton is pressed. After it is pressed a dialog !o/ appears with the user to select the difficult le"el. After the selection# this function loads the pu..le and starts the main game function. 9.2.1.3.1 'ifficultThis function allows the user to select the difficult le"el. The difficult le"els are eas # medium# and hard. +nce the difficult is selected it is store in the data o!'ect. Then the pu..le is retrie"ed !ased on the difficult . 9.2.1.3.2 2oad /u00le This function ta$es the pu..le from the difficult data o!'ect and passes it to the main game function to !e drawn. 9.2.1.4 Main Game This function loads the main game and allows the user to pla the game. 1hen a tile is selected# it shows the num!ers that can !e pla ed. &t calls the hints function to color squares differentl . This function is run all the num!ers are filled or the game is e/ited. 9.2.1.4.1 'raw 1oard 3"er time a num!er is selected then the !oard is redrawn to show those changes. This function draws the lines# num!ers# !ac$ground# and different colors for the hinted tiles. 9.2.1.4.2 Select *ile This function deals with when a user selects a tile on the !oard. 1hen a tile is selected it is turned a different color. &t then calls the hints function and !rings up the select num!ers function. 9.2.1.4.3 Select .umbers

22

This function !rings up a dialog !o/ that shows the a"aila!le num!ers to select for that tile. +nce the num!er is selected it sends it to the main game function to get drawn. 9.2.1.4.4 4ints This function goes through the !oard and finds the a"aila!le num!ers for each tile. &t uses the amount of num!ers a"aila!le to pic$ a color for that tile. 9.2.1.4.6 8nd Game This function ends the current game and goes to the main menu of Sudo$u. 9.2.2 Software Interface 'escription Sudo$u uses one interface that the user can see. The one that the see is through the cell phone. The cell phone must !e running the Android operating s stem. 9.2.2.1 8xternal mac(ine interfaces The game will run on two different machines. +ne is an emulator of a cell phone that is used for de"elopment and testing. The other is the user7s cell phone that hosts the game. The game must !e compati!le with the Android operating s stem. 9.2.2.2 8xternal s-stem interfaces The game does not use an e/ternal interfaces. All components of the game are internal. 9.2.2.3 4uman interface This is the main interface that the user will interact with. The interface will allow the user to use the phones touch screen ser"ices and analog !uttons. This interface is clear and eas to use. &t shows !uttons and te/t so the user can understand what is going on. 9.2.3 &ontrol 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 !e different states of the game. This continues till the game is finished. This descri!ed in section 0.0 and its su!sections. 9.3 1e(avioral Model and 'escription 9.3.1 'escription for software be(avior 9.3.1.1 8vents 9.3.1.1.1 .ew Game 1utton /ressed A new game is started# pu..le drawn# and !oard is drawn. 24

9.3.1.1.2 )bout 1utton /ressed Shows the rules and information of the game. 9.3.1.1.3 8xit 1utton /ressed 3/its the game to the games main menu. 9.3.1.1.4 Menu /ressed A menu pops of with the settings !utton. 9.3.1.1.6 Settin! 1utton /ressed A new page is shown with settings of the game to !e set. 9.3.1.1.7 4ints $ption 1utton /ressed This e"ent turns on and off the hints function of the game. 9.3.1.1.9 Music $ption 1utton /ressed The e"ent turns on and off the music of the game. 9.3.1.1.: 'ifficult- Selected 1hen the new game is selected the user is presented with an option to select the difficult of the game. The option is then passed to the game. 9.3.1.1.; *ile Selected 1hen inside the main game the user will select tiles to put or change a num!er in. 1hen a tile is selected it !rings up a menu to pic$ what num!er goes inside the square. 9.3.1.1.10 'raw 1oard This e"ent is called at the !eginning of the game and after a new num!er is selected. 9.3.1.2 States 9.3.1.2.1 Main Menu The main menu is selected when the Sudo$u game is selected. &t has !uttons for a new game# a!out page# e/it# and a menu. 9.3.1.2.2 )bout The a!out page is a dialog !o/ that shows the rules of the game. 9.3.1.2.3 8xit This e/its the game to the main menu of the game suite.

-0

9.3.1.2.4 Menu This page is shown when the analog menu !utton is pressed on the phone. &t shows a settings !utton. 9.3.1.2.6 Settin!s The settings page allows the user to change the settings for the music and hints of the game. 9.3.1.2.7 4ints This displa s a !utton to turn onEoff hints. 9.3.1.2.9 Music This displa s a !utton to turn onEoff music. 9.3.1.2.: 'ifficult- Selected This displa s a dialog !o/ with the options to select the difficult of the game. 9.3.1.2.; *ile Select This is the main page of the game to !e displa ed. &t shows the !oard drawn and allows the user to select a tile or end the game. 9.3.1.2.10 .umber Select From the hints function the num!ers a"aila!le are retrie"ed. &t displa s the num!er is a dialog !o/ with a !utton for each a"aila!le num!er. 9.3.2 State *ransition 'ia!rams

-1

#i!ure eleven% Sudo3u State 'ia!ram

:.0 ,estrictions? 2imitations? and &onstraints The application is !eing de"eloped for the Android operating s stem and as such should !e compati!le with at least the ma'orit of the current "ersions of Android which are 1.1# 1.0# 1.6# 2.0# and 2.0.1. The application must !e designed to displa correctl on the wide range of mo!ile phones which run the Android operating s stem. The o"erall application and its indi"idual parts must !e designed to run smoothl and quic$l on the relati"el limited processing power of mo!ile de"ises. ;.0 5alidation &riteria Calidation for the application will mostl !e focused around the end user use case. 1hile not all possi!le scenarios can !e tested "alidation will consist of testing a reasona!le num!er of cases to declare that all cases should wor$. ;.1 &lasses of tests ;.1.1 +elcome Screen -2

% *o"e !etween the 1elcome screen and the a"aila!le games multiple times and in "ar ing orders. ;.1.2 +ord Searc( % Select $nown "alid words for multiple pu..les. % Select $nown in"alid words. % 3nd game# e/it program# and re%launch. ;.1.3 &onnect #our % :un through multiple games from start to finish with "ar ing end game scenarios. % 3/it program mid game and re%launch. ;.1.4 1attles(ip % :un through multiple games from start to finish with "ar ing end game scenarios. % 3/it program mid game and re%launch. ;.1.6 4an!man % :un through multiple games from start to finish with "ar ing end game scenarios. % 3/it program mid game and re%launch. ;.1.7 Sudo3u % :un through multiple games from start to finish with "ar ing end game scenarios. % 3/it program mid game and re%launch. ;.2 8xpected software response ;.2.1 +elcome Screen % &ndi"idual should launch and close cleanl and smoothl # returning to the 1elcome screen when closed. ;.2.2 +ord Searc( % Calid words should !e accepted and added to the current score. % &n"alid words should !e re'ected. % Game should open and close cleanl and high score should !e persistent when re%launching. ;.2.3 &onnect #our % &ndi"idual chips should !e placed properl when specific columns are selected. The game should end when four chips of the same color connect hori.ontall # "erticall # diagonall . % Game should open and close cleanl and game state should !e restored if the application was closed mid game.

--

;.2.4 1attles(ip % &ndi"idual (shots( should register as hits when the occur at a location occupied ! an opponent7s ship. The game should end when all enem ships ha"e !een destro ed % Game should open and close cleanl and high score should !e persistent when re%launching. ;.2.6 4an!man % &ndi"idual letters should register as !eing part of the target word if the are. &ncorrect letters should result in the addition of a !od 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 cleanl and high score should !e persistent when re%launching. ;.2.7 Sudo3u % &ndi"idual entries should !e registered on the !oard and the game should end when the pu..le has !een sol"ed. % Game should open and close cleanl and high score should !e persistent when re%launching. ;.3 /erformance bounds All games and their indi"idual su!s stems should run smoothl and quic$l . 10.0 )ppendices 10.1 /roduct Strate!ies +ur product will !e li$el su!mitted in the Android *ar$et <lace. &t will li$el !e free to the user and will require no ad"ertisement. 10.2 Supplementar- information The following is a screen shot of the emulator we use to de"elop our program.

-4

#i!ure twelve% )ndroid $S 8mulator

-0

You might also like