This one should always run the same amount of time, think it's O(n^2/2)
The seq() array will be the resulting order of numbers
dim seq(25)
dim used(25)
for i=1 to 25
j=rnd(25-i)+1
for k=1 to j
if used(k) then inc j
next k
seq(i)=j
used(j)=1
next i
Or if you'd like more control over the length of time it takes to generate, and use less memory, this one should be O(n), where n is chosen by yourself
dim seq(25)
n=625
for i=1 to 25
seq(i)=i
next i
for i=1 to n
a=rnd(24)+1
b=rnd(24)+1
temp=seq(a)
seq(a)=seq(b)
seq(b)=temp
next i
Edit: I just noticed Mentor had already suggested this last one
Here's a nice game of pickup 52
dim floor(52)
dim hand(52)
`Drop all the cards on the floor
for i=1 to 52
floor(i)=i
next i
`Count where all the cards are
floorcount=52
handcount=0
`While there are still cards on the floor
while floorcount>0
`Choose a card on the floor
floor_id=rnd(floorcount-1)+1
card=floor(floor_id)
`Put the card in our hand
inc handcount
hand(handcount)=card
`Remove the card from the floor
floor(floor_id)=floor(floorcount)
dec floorcount
endwhile