[REBOL] Re: A Rebol Challenge. The Monty Hall Puzzle
From: sunandadh:aol at: 16-Dec-2001 10:19
Hi Romano,
> Beautiful! You can remove the n + 1:
>
> Win: 0 n: 500 print ["Win%" 100 / n * loop n [win: win + last sort next
> random
> [0 0 1]]]
>
Thanks. I thought I'd minimised it completely, but it's amazing what teamwork
can do.
If we just want to print the winning percentage, and we shorten the variable
names we get:
W: 0 n: 500 100 / n * loop n [w: w + last sort next random [0 0 1]]
which is just
length? {W: 0 n: 500 100 / n * loop n [w: w + last sort next random [0 0 1]]}
67 bytes. Which--spookily enough--equals our win percentage for swapping.
Sunanda.