Fucking FAILURE! - Shad0w
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Fucking FAILURE! - Shad0w
 
HomePortalLatest imagesRegisterLog in
Top posters
shad0w
[VB6] Hi-Lo [Game] I_vote_lcap[VB6] Hi-Lo [Game] I_voting_bar[VB6] Hi-Lo [Game] I_vote_rcap 
rdwuestewald
[VB6] Hi-Lo [Game] I_vote_lcap[VB6] Hi-Lo [Game] I_voting_bar[VB6] Hi-Lo [Game] I_vote_rcap 
Crush Combat
[VB6] Hi-Lo [Game] I_vote_lcap[VB6] Hi-Lo [Game] I_voting_bar[VB6] Hi-Lo [Game] I_vote_rcap 
banksy
[VB6] Hi-Lo [Game] I_vote_lcap[VB6] Hi-Lo [Game] I_voting_bar[VB6] Hi-Lo [Game] I_vote_rcap 
Kewley
[VB6] Hi-Lo [Game] I_vote_lcap[VB6] Hi-Lo [Game] I_voting_bar[VB6] Hi-Lo [Game] I_vote_rcap 
Ashley
[VB6] Hi-Lo [Game] I_vote_lcap[VB6] Hi-Lo [Game] I_voting_bar[VB6] Hi-Lo [Game] I_vote_rcap 
Anthony
[VB6] Hi-Lo [Game] I_vote_lcap[VB6] Hi-Lo [Game] I_voting_bar[VB6] Hi-Lo [Game] I_vote_rcap 
Inix
[VB6] Hi-Lo [Game] I_vote_lcap[VB6] Hi-Lo [Game] I_voting_bar[VB6] Hi-Lo [Game] I_vote_rcap 
mitch
[VB6] Hi-Lo [Game] I_vote_lcap[VB6] Hi-Lo [Game] I_voting_bar[VB6] Hi-Lo [Game] I_vote_rcap 
dukemaster95
[VB6] Hi-Lo [Game] I_vote_lcap[VB6] Hi-Lo [Game] I_voting_bar[VB6] Hi-Lo [Game] I_vote_rcap 
Who is online?
In total there are 49 users online :: 0 Registered, 0 Hidden and 49 Guests

None

Most users ever online was 189 on Mon Oct 21, 2024 3:57 am

 

 [VB6] Hi-Lo [Game]

Go down 
AuthorMessage
shad0w




Number of posts : 173
Points : 238
Reputation : 0
Registration date : 2009-03-18
Location : 127.0.0.1

[VB6] Hi-Lo [Game] Empty
PostSubject: [VB6] Hi-Lo [Game]   [VB6] Hi-Lo [Game] EmptyThu Mar 19, 2009 7:22 pm

This program creates a game of hi-lo where you get to risk point and gain double or lose points. Kind of like a guessing game but with points.

Code:
'************************************************************
'Creates a game of hi-lo where the player risks points and gains double
'if his guess is in the correct range.
'************************************************************

Option Explicit

Private intrandom As Integer
Const inthigh As Integer = 13
Const intlow As Integer = 1
Private intrisk As Integer
Private intplayertotal As Integer

Private Sub cmdDone_Click()
    Unload Me
End Sub

Private Sub cmdhigh_Click()
    intrandom = rndint(inthigh, intlow)
    intrisk = txtrisk.Text

    If intrandom >= 8 And intrandom <= 13 Then
          intplayertotal = intplayertotal + (2 * intrisk)
          lblmessage.Caption = "You Win! The number was " & intrandom & vbCrLf & "Total points = " intplayertotal
    Else 
          lblmessage.Caption = "You Lose! The number was " & intrandom & vbCrLf & "Total points = " intplayertotal
    End If
End Sub

Private Sub cmdlow_Click()
    intrandom = rndint(inthigh, intlow)
    intrisk = txtrisk.Text

    If intrandom >= 1 And intrandom <= 6 Then
              intplayertotal = intplayertotal + (2 * intrisk)
          lblmessage.Caption = "You Win! The number was " & intrandom & vbCrLf & "Total points = " intplayertotal
    Else 
          lblmessage.Caption = "You Lose! The number was " & intrandom & vbCrLf & "Total points = " intplayertotal
    End If
End Sub

Private Sub Form_Load()
    Randomize
    intplayertotal = 1000
End Sub

Private Sub txtrisk_Change()
    lblmessage.Caption = ""
End Sub

'********************************************************
'Finds a random number between 13 and 1 and assigns it to rndint
'
'post: rndint is a random number between 1 and 13.
'********************************************************

Function rndint(ByVal inthigh As Integer, ByVal intlow As Integer) As Integer
    rndint = Int(inthigh * Rnd + intlow)
End Function
Back to top Go down
 
[VB6] Hi-Lo [Game]
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Fucking FAILURE! - Shad0w :: Shad0w's Computer Section :: Coding :: Visual Basic-
Jump to: