Kevin (streetfiighter) wrote in visualbasic,
Kevin
streetfiighter
visualbasic

NEED HELP!

Ok i have an array with 75 elements called balls(74), for an automated bingo program.
The trouble is I am having a hell of a time randomizing the array so it does not have any visible pattern
(ie. 3 Bs in a row, which the odd are like 1 in 125 of normally happening, yet i get patterns like that occuring every game)

here is what im working with...
Randomize()

Dim i As Integer
Dim j As Integer
Dim tmp_value As String

For i = 0 To 74
j = Int((74 - i + 1) * Rnd() + i) 'finds random place in array
tmp_value = balls(i) 'assigns current position
balls(i) = balls(j) 'replaces current position
balls(j) = tmp_value 'assigned original position to replacement's index
Next i

any help would be appreciated
Subscribe
  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 5 comments