# count numbers selected by randomize

Working on a keno game. have added a Autoplay with an option to stop Auto play after user defined # of times with a max of 2000.if user selects 2000 the the game will randomize  80 numbers with 20 selections for each randomize and update the results with each run. Some one asked me to add a feature to display the most popular number of the 80 being hit.

What could i use to keep track of how many times each number is selected and display the results. Preferably sorted by the highest hit number at the top?
Example:
number 1, hit 25 times
number 2, hit 35 times
number 3, hit 55 times
etc,etc
all the way to number 80
###### Who is Participating?

Middle School Assistant TeacherCommented:
You could keep a simple array and increment the number by incrementing the index value:

Dim ValueCount(1 to 80) As Long

So if number 40 was picked, you increment index 40:

ValueCount(40) = ValueCount(40) + 1

Here's some example code for sorting small arrays:
http://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_22705695.html#a19522856
0

Author Commented:
thank you pretty simple
0

Author Commented:
could you show me how to write this:
Dim mNumberCount(1 To 80) As Long 'form declaration
mNumberCount(i) = DrawnNumber (i)
mNumberCount(i) = mNumberCount(i) + 1

DrawnNumber (i) is the number selected
0

Middle School Assistant TeacherCommented:
It would be something more like

Dim number As Long
Dim mNumberCount(1 To 80) As Long 'form declaration

number = DrawnNumber (i)
mNumberCount(number) = mNumberCount(number) + 1
0

Author Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.