Basic Number Guessing Game In VB

Any help regarding any computer based programming language (non serverside) can be requested and recieved here.
Locked
ag3nt
Posts: 80
Joined: Mon Apr 30, 2007 6:57 pm

Basic Number Guessing Game In VB

Post by ag3nt »

'add 1 commandubtton named command1 and 1 textbox named text1


Private Sub Command1_****()
Dim x As Integer ' declare x variable as integer
x = Int(Rnd * 9) + 1 ' randomize numbers 0 to 9
If Text1.Text = x Then ' if user is true then
MsgBox "congrulations!you won,answer was " & x
Else
MsgBox "sorry wrong"
End If
End Sub


basic game to understand basics of vb


New And Crazy Member Of SmokyHosts Community

By Ag3nt
anish
Posts: 353
Joined: Fri Apr 27, 2007 12:34 pm
Contact:

Post by anish »

Nice its a cool code in vb script for a simple game.
It have been some months that i am studying about VB. Its a cool programme.
Locked