Re: A86: Re: Howto Create distinct random-integer lists
[Prev][Next][Index][Thread]
Re: A86: Re: Howto Create distinct random-integer lists
In a message dated 10/4/98 12:31:26 PM Eastern Daylight Time, QmH@aol.com
writes:
> << here's the easiest way:
> Make two lists. The first list is the sequence of numbers that you want to
> 'shuffle'. The second list is a list of random numbers. then sort both
> lists, using the random list as the 'sort key':
> Seq(X,X,1,10,1) STO L1
> Seq(Rand,X,1,10,1) STO L2
> SortA L2,L1 >>
how about this slight modification:
seq(x,1,10)->L1
randInt(1,10,10)->L2
SortX L2,L1
this is a little bit smaller in size, and probably in speed as well. i'm not
really claiming credit for this, because i never would've thought of this
method without this guy's original idea. i think this is a tiny bit better,
though.