Friday, September 17, 2010

Programming Assessment Task Documentation

Introduction
(Replace this with: what is the purpose or problem that the program is trying to solve)

the purpose of the program is to provide a entertaining gabe which allows to enable two players/users to play tic tac toe against each other, and to result in either a win for one player/user or a no result.

Algorithm Outlining the Program
(put your flow chart here)



Explanation of Data Types used

(What types are used in the variables in your program and where ? Remember the DIM statement)

Text

there are labels for the instructions and the score, also text on the buttons to identify where the players opponent has placed either X or O, which therefor allows you the outcome of your choice (either a win or no result).
eg. button1.text= X and button2.text=X and button3.text=X then label1.text= Player X Wins !

Integer

the variable 'turn' in an integer. this variable allows the whole game to function as this is what allows the game to have more than one outcome.
eg. Dim turn as integer

Control Structure examples

(copy and paste the appropriate section from your program and explain)
Sequence:
You click on 1 of the 9 squares to allow the game to begin. Then your opponent attempts to change the outcome of the game by creating a no win situation.

Selection:

this section involves selection as it involves the words 'and' and 'else if'. These present to the computer conditions or a criteria that it must make a selection out of.

Repetition:

There is no repetition present within the program code. The only slight repition is the reset button which after the game results in either a win or no result, the player has the option to enable all buttons and to start again.

Use of Error Detection

The program handles incorrect user inputs and thereby stopping user created errors by limiting the options or possibilities for a user to enter incorrect values to start with. Through the use of buttons, the user is has no option other then to click on one of the nine buttons, as these are the only ones that are available. there is no room for user input error.

No comments:

Post a Comment