Code: (Select All)
top = 500
bottom = 50
n = 100
Randomize Timer
Print n; " random integers between:"; bottom; " and"; top
'create deck
Dim deck(bottom To top)
For i = bottom To top
deck(i) = i
Next
'shuffle it
For i = top To bottom + 1 Step -1
Swap deck(Int(Rnd * (i - bottom + 1)) + bottom), deck(i)
Next
'report
For i = 1 To n
Print deck(i + bottom);
NextI had to run it with this code to debug it to make sure top and bottom numbers were included:
Code: (Select All)
top = 60
bottom = 50
n = 10
Randomize Timer
Print n; " random integers between:"; bottom; " and"; top
'create deck
Dim deck(bottom To top)
For i = bottom To top
deck(i) = i
Next
'shuffle it
For i = top To bottom + 1 Step -1
Swap deck(Int(Rnd * (i - bottom + 1)) + bottom), deck(i)
Next
'report
For i = 1 To n
Print deck(i + bottom);
NextSo +1 to eric for my morning QB64 quiz!
Guess I was bored too
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever

