VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



make the dice roll 100 times and count the number of snake eyes

by Anonymous (267 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 7th November 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

make the dice roll 100 times and count the number of snake eyes

Rate make the dice roll 100 times and count the number of snake eyes



'Program to get results of rolled dice
'Program created by: Rosaire Pilon
'Program created for: Mike Venhola
'Program Date: July 10, 2002

Dim intRoll1 As Integer, intRoll2 As Integer
Dim sngResults As Single

intRoll1 = Int(6 * Rnd) + 1
intRoll2 = Int(6 * Rnd) + 1

Do
    sngResults = intRoll1 + intRoll2
    picOutput.Print sngResults;
    
Loop Until 100

 End Sub

Private Sub Form_Load()

Randomize   'Seed the Random Number Generator


End Sub

Private Sub cleardice()
shpdicenw.Visible = False
shpdicew.Visible = False
shpdicesw.Visible = False
shpdicec.Visible = False
shpdicene.Visible = False
shpdicee.Visible = False
shpdicese.Visible = False
shpdice2nw.Visible = False
shpdice2w.Visible = False
shpdice2sw.Visible = False
shpdice2c.Visible = False
shpdice2ne.Visible = False
shpdice2e.Visible = False
shpdice2se.Visible = False

End Sub

Private Sub showdice(intface As Integer)
Call cleardice
Select Case intface
    Case 1
        shpdicec.Visible = True
    Case 2
        shpdicesw.Visible = True
        shpdicene.Visible = True
    Case 3
        shpdicec.Visible = True
        shpdicesw.Visible = True
        shpdicene.Visible = True
    Case 4
        shpdicenw.Visible = True
        shpdicene.Visible = True
        shpdicesw.Visible = True
        shpdicese.Visible = True
    Case 5
        shpdicenw.Visible = True
        shpdicene.Visible = True
        shpdicesw.Visible = True
        shpdicese.Visible = True
        shpdicec.Visible = True
    Case 6
        shpdicew.Visible = True
        shpdicee.Visible = True
        shpdicenw.Visible = True
        shpdicene.Visible = True
        shpdicesw.Visible = True
        shpdicese.Visible = True
End Select
End Sub

Private Sub showdice(intface As Integer)
Call cleardice
Select Case intface
    Case 1
        shpdice2c.Visible = True
    Case 2
        shpdice2sw.Visible = True
        shpdice2ne.Visible = True
    Case 3
        shpdice2c.Visible = True
        shpdice2sw.Visible = True
        shpdice2ne.Visible = True
    Case 4
        shpdice2nw.Visible = True
        shpdice2ne.Visible = True
        shpdice2sw.Visible = True
        shpdice2se.Visible = True
    Case 5
        shpdice2nw.Visible = True
        shpdice2ne.Visible = True
        shpdice2sw.Visible = True
        shpdice2se.Visible = True
        shpdice2c.Visible = True
    Case 6
        shpdice2w.Visible = True
        shpdice2e.Visible = True
        shpdice2nw.Visible = True
        shpdice2ne.Visible = True
        shpdice2sw.Visible = True
        shpdice2se.Visible = True
End Select

        
End Sub


Download this snippet    Add to My Saved Code

make the dice roll 100 times and count the number of snake eyes Comments

No comments have been posted about make the dice roll 100 times and count the number of snake eyes. Why not be the first to post a comment about make the dice roll 100 times and count the number of snake eyes.

Post your comment

Subject:
Message:
0/1000 characters