[REBOL] Re: Question and comment about randomizing a block of values
From: petr:krenzelok:trz:cz at: 19-Jun-2001 19:35
----- Original Message -----
From: "GS Jones" <[gjones05--mail--orion--org]>
To: <[rebol-list--rebol--com]>
Sent: Tuesday, June 19, 2001 6:23 PM
Subject: [REBOL] Re: Question and comment about randomizing a block of
values
> From: "Jeff Kreis"
> > random/seed now/time
> > c: 0
> > x: random reduce head insert/dup copy [] [c: c + 1] 52
> >
> > ; -- produces a block of 1 - 52 randomly ordered
>
> I've been thinking about this on and off for two hours, and I still do not
> understand how this statement works. Can someone state what is going on
in
> other words?
->> x: insert/dup copy [] [c: c + 1] 52
== []
->> head x
== [c: c + 1 c: c + 1 c: c + 1 c: c + 1 c: c + 1 c: c + 1 c: c + 1 c: c + 1
c: c + 1 c: c + 1 c: c + 1 c: c + 1 c: c + 1 c: c
+ 1 c...
->> c: 0
== 0
->> reduce head x
== [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
45 4...
I hope it is self explanatory now (in fact - it is crazy! :-) "Insanely
great" :-)
-pekr-