Making a randomizer...
OK so I have this code but I have no idea how to make it random... I though I could but the code is really wierd. Its for my Deal or No Deal game, heres the code of one of the things... I think its really bad and thats why I cant figure it out
The gamedecidetb was a failed attemp at making it random )':
Code
Code:
Private Sub case5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles case5.Click
If gamedecidetb.Text = "1" Then
If sidebar1.Enabled = False And sidebar2.Enabled = False And sidebar3.Enabled = False And sidebar4.Enabled = True And sidebar5.Enabled = False And sidebar6.Enabled = False And sidebar7.Enabled = False And sidebar8.Enabled = False And sidebar9.Enabled = False And sidebar10.Enabled = False And sidebar11.Enabled = False And sidebar12.Enabled = False And sidebar13.Enabled = False And sidebar14.Enabled = False And sidebar15.Enabled = False And sidebar16.Enabled = False And sidebar17.Enabled = False And sidebar18.Enabled = False And sidebar19.Enabled = False And sidebar20.Enabled = False And sidebar21.Enabled = False And sidebar22.Enabled = False And sidebar23.Enabled = False And sidebar24.Enabled = False And sidebar25.Enabled = False And sidebar26.Enabled = False And gamedecidetb.Text = "1" Then
MsgBox("You have won $10.")
playagain()
End If
If sidebar1.Enabled = False And sidebar2.Enabled = False And sidebar3.Enabled = False And sidebar4.Enabled = False And sidebar5.Enabled = False And sidebar6.Enabled = False And sidebar7.Enabled = False And sidebar8.Enabled = False And sidebar9.Enabled = False And sidebar10.Enabled = False And sidebar11.Enabled = False And sidebar12.Enabled = False And sidebar13.Enabled = False And sidebar14.Enabled = False And sidebar15.Enabled = False And sidebar16.Enabled = False And sidebar17.Enabled = False And sidebar18.Enabled = False And sidebar19.Enabled = False And sidebar20.Enabled = False And sidebar21.Enabled = False And sidebar22.Enabled = False And sidebar23.Enabled = False And sidebar24.Enabled = False And sidebar25.Enabled = False And sidebar26.Enabled = False And gamedecidetb.Text = "1" Then
playagain()
End If
sidebar4.Enabled = False
case5.Enabled = False
End If
caseleft = caseleft - 1
counter = counter + 1
total = total - 10
If counter = 5 Then
bankoffer = total / caseleft
yesno = MsgBox("The banker offers " & bankoffer, vbYesNo)
If yesno = vbYes Then
MsgBox("You have won " & bankoffer)
playagain()
Else
End If
End If
If counter = 10 Then
bankoffer = total / caseleft
yesno = MsgBox("The banker offers " & bankoffer, vbYesNo)
If yesno = vbYes Then
MsgBox("You have won " & bankoffer)
playagain()
Else
End If
End If
If counter = 14 Then
bankoffer = total / caseleft
yesno = MsgBox("The banker offers " & bankoffer, vbYesNo)
If yesno = vbYes Then
MsgBox("You have won " & bankoffer)
playagain()
Else
End If
End If
If counter = 18 Then
bankoffer = total / caseleft
yesno = MsgBox("The banker offers " & bankoffer, vbYesNo)
If yesno = vbYes Then
MsgBox("You have won " & bankoffer)
playagain()
Else
End If
End If
If counter = 21 Then
bankoffer = total / caseleft
yesno = MsgBox("The banker offers " & bankoffer, vbYesNo)
If yesno = vbYes Then
MsgBox("You have won " & bankoffer)
playagain()
Else
End If
End If
If counter = 24 Then
bankoffer = total / caseleft
yesno = MsgBox("The banker offers " & bankoffer, vbYesNo)
If yesno = vbYes Then
MsgBox("You have won " & bankoffer)
playagain()
Else
End If
End If
End Sub
The gamedecidetb was a failed attemp at making it random )':


