[REBOL] Re: sort/scramble
From: joel:neely:fedex at: 3-Jan-2004 20:06
Hi, Hallvard,
Hallvard Ystad wrote:
> Hi
>
> I need a function that will make sure a block is _not_ sorted.
>
How about this:
>> random [0 1 2 3 4 5 6 7 8 9]
== [8 9 3 4 2 1 7 6 0 5]
Of course, there's a 1 in 3628800 chance that a random arrangement
of ten values will actually be in order! ;-)
If you really mean *NOT* sorted (and your values are distinct), but
don't care about randomness, then
reverse sort foo
will make sure that FOO is _not_ sorted in ascending order.
Can you provide a little more detail on your requirements?
-jn-