Everybody needs this i suppose, great for puzzle games
it randomizes your regular series of numbers into irregular order
(1,2,3,4,5...) into (3,5,2,1,4,....)etc.
top:
Print "This function turns your regular series(1,2,3,4,5,...)"
Print "to randomized order (4,2,5,1,3,.......) without missing any number in the serie"
Print "and makes sure none of the numbers are the same in the serie"
Print "PRESS ANY KEY TO RE-CREATE A NEW SERIE"
Serie = rnd(20)
randomSerie(Serie)
For t = 1 To Serie
Print t,"--------";
Print rndSerie(t)
Next t
Wait Key : cls
goto top
Function randomSerie(Total)
DIM rndSerie(Total)
For i = 1 To Total
Repeat
X = Rnd(Total)
bFound = 0
For j = 1 To i
If rndSerie(j) = X
bFound = 1
Exit
EndIf
Next j
Until bFound = 0
rndSerie(i) = X
Next i
EndFunction