Trouble with arrays
Posted: Sun Oct 26, 2003 10:41 pm
I'm having a bit of trouble with arrays.
I'm trying to list the numbers from 1 to 94 in random order. But everytime I run this code it displays, "0 0 0 0 0 0 . . ." What am I doing wrong?[/code]
Code: Select all
Dim long_array.b(94)
Repeat
do_over=0
For J = 0 To 93
random_number=Random(93) + 1
For K=0 To J
If random_number = long_array(K)
do_over=1
EndIf
Next K
If do_over = 0
random_number = long_array(J)
EndIf
Next J
Until do_over=0
OpenConsole()
For K=0 To 93
Print(Str(long_array(K)))
Print(" ")
Next K
PrintN("")
Print("Press 'Enter' to continue")
pause$=Input()
CloseConsole()
End