Introduction
The purpose or problem that the Pogram Visual Basic is undertaking is to see who wins the game of noughts and crosses. It is to accomodate the players with pleasure. This game is to especially entertain 2 players per game. When the 2 players decide on who is noughts and who is crosses the game will begin, the program will automatically tell you who wins. they decide who is nougths and who is crosses they would begin the game. Also The program will tell whos turn it is next.
Algorithm outlining the Program
My flowchart below shows on how the game of noughts and crosses, the works of the game.
Explanation of Data Tyes used
Text;
ElseIf Button4.text = "X" And Button5.text = "X" And Button6.text = "X" Then
MsgBox("Player X wins!1")
Label6.Text += 1
Call disablebuttons( )
This label is a text variable. This label is needed for people to see what is happening with the game .
There is also a button for instructions involving text, score and the outcome in whether you won, lost or drew, involving text.
Integer;
Dim turn As Integer
Control Structure examples
Sequence;
This section is to be placed at the beginning of the coding section. Without this section the program will not work.
Selection;
If Button1.text = "X" And Button2.text = "X" and Button3.text = "X" Then
Msgbox("Player X Wins!!")
Label6.text +=
Call disablebuttons ( )
This part of the coding is the selection which involves and and if. This tells the computer that it is compulsory to make the selection out of these.\
Also another way of selection to take action is by starting a new game and that is by clicking New Game.
Repetiton:
There is no repetition in my game, however by playiong the game over and over again,
Use of Error Detection
The program of Visual Basic stops error by restricting the chances and benefit the user to enter the incorrect values. I have made my game to prevent any failures that may take place during this game.
By:Lenia Kelleyan
No comments:
Post a Comment