arrays

decypher

Member
Joined
Feb 14, 2005
Messages
7
Programming Experience
Beginner
ok i wrote a console program that outputs 12 random numbers...but now i need to change it so it outputs a random amount of "#" characters, (scaled down by 1/4 so they fit on the screen) heres is what i got, can help me make the changes? i'm completely lost:

Sub Report(ByVal frequency() As Integer)

Dim i As Integer

For i = 2 To 12

Console.WriteLine(
CStr(i) & " = " & CStr(frequency(i)))

Next

End Sub

Sub Main()

Dim randomDie As New Random

Dim frequency(12) As Integer

Dim i As Integer

Dim diceValue As Integer

For i = 2 To 12

frequency(i) = 0

Next

For i = 1 To 1000

diceValue = randomDie.Next(1, 7) + randomDie.Next(1, 7)

frequency(diceValue) += 1

Next

Call Report(frequency)

End Sub

 

decypher

Member
Joined
Feb 14, 2005
Messages
7
Programming Experience
Beginner
so i'm thinking you do something to the sub report, or maybe there is a way to convort it later? i dunno ... help!!
 
Top Bottom