All pastes #2083195 Raw Edit

Mine

public text v1 · immutable
#2083195 ·published 2011-09-27 00:45 UTC
rendered paste body
Public Distance As Integer 'Shot Distance
Public Yards As Integer 'Yards Left
Public Shots As Integer 'Number Of Shots
Public Total As Integer ' Total amount of yards
Public NextShot As Integer ' After shooting holds amount of Yards Left
Public Hole As Integer ' Hole number

Private Sub cmdNew_Click()
txtShot.Text = ""
txtDistance.Text = ""
Shots = 0
cmdShoot.Visible = True
cmdNew.Visible = False

If Hole = 1 Then
    txtYards.Text = "100"
ElseIf Hole = 2 Then
    txtYards.Text = "200"
ElseIf Hole = 3 Then
    txtYards.Text = "300"
End If
End Sub

Private Sub cmdNext_Click()
Total = Yards
Shots = Shots + 1
Randomize
Distance = Int(Total * Rnd) + 1
Yards = Total - Distance
HS2 = Distance
txtHole.Text = Hole

txtDistance.Text = Str$(Distance)
txtShot.Text = Str$(Shots)
txtYards.Text = Str$(Yards)

If Yards = 0 Then
    Hole = Hole + 1
    cmdNew.Visible = True
    cmdNext.Enabled = False
End If

If Shots = 2 Then
    lbl12 = Str$(Distance)
ElseIf Shots = 3 Then
    lbl13 = Str$(Distance)
ElseIf Shots = 4 Then
    lbl14 = Str$(Distance)
ElseIf Shots = 5 Then
    lbl15 = Str$(Distance)
ElseIf Shots = 6 Then
    lbl16 = Str$(Distance)
ElseIf Shots = 7 Then
    lbl17 = Str$(Distance)
ElseIf Shots = 8 Then
    lbl18 = Str$(Distace)
ElseIf Shots = 9 Then
    lbl19 = Str$(Distance)
End If


End Sub

Private Sub cmdShoot_Click()

Hole = txtHole.Text
cmdNext.Enabled = True

If Hole = 1 Then
    Total = 100
    Shots = Shots + 1
    Randomize
    Distance = Int(100 * Rnd) + 1
    Hole = txtHole.Text

    txtDistance.Text = Str$(Distance)
    txtShot.Text = Str$(Shots)
    Yards = Total - Distance
    txtYards.Text = Str$(Yards)
    lbl11 = Str$(Distance)
    cmdShoot.Visible = False

ElseIf Hole = 2 Then
    Total = 200
    Shots = Shots + 1
    Randomize
    Distance = Int(200 * Rnd) + 1
    Hole = txtHole.Text
    
    txtDistance.Text = Str$(Distance)
    txtShot.Text = Str$(Shots)
    Yards = Total - Distance
    txtYards.Text = Str$(Yards)
    lbl21 = Str$(Distance)
    cmdShoot.Visible = False
ElseIf Hole = 3 Then
    Total = 300
    Shots = Shots + 1
    Randomize
    Distance = Int(300 * Rnd) + 1
    Hole = txtHole.Text
    
    txtDistance.Text = Str$(Distance)
    txtShot.Text = Str$(Shots)
    Yards = Total - Distance
    txtYards.Text = Str$(Yards)
    cmdShoot.Visible = False
End If
End Sub

Private Sub Command1_Click()
Form2.Visible = True
End Sub

Private Sub Form_Load()
cmdNew.Visible = False
cmdNext.Enabled = False
End Sub