Dice Roll Program

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'1 Set up Var
Dim dice(6000) As Integer
Dim results(6) As Integer
Dim target As Integer

'2 Roll 6000 dice
Call RollDice(dice)

'3 For Each Side of the dice
For Target = 1 To 6
'4 Count each side
Call count_occurrences(Target, dice, results(Target))
'5 next
Next

'6 Display
Call Display(results)
End Sub

Private Sub RollDice(ByRef dice() As Integer)
Dim counter As Integer
Randomize()
For counter = 1 To 6000
dice(counter) = Int(Rnd() * 6) + 1
Next
End Sub

Private Sub count_occurrences(ByVal target As Integer, ByRef Int_array() As Integer, ByRef counter As Integer)
'counting occurrences with an array of 10 strings
Dim pointer As Integer
counter = 0
For pointer = 1 To 6000
If Int_array(pointer) = target Then counter = counter + 1
Next
End Sub

Private Sub Display(ByRef results() As Integer)
Dim Counter
'clear listbox
lstOutput.Items.Clear()
'Display
For Counter = 1 To 6
lstOutput.Items.Add(Counter & vbTab & results(Counter))
Next
End Sub
End Class