[REBOL] Re: A Rebol Challenge. The Monty Hall Puzzle IN 0 BYTES
From: brett:codeconscious at: 19-Dec-2001 12:56
> But the goal is to not keep making the example shown with the C, MatLab,
> Pearl smaller, but to make a more verbose accurate portrayal of the
> puzzle in Rebol.
Here is a very verbose version of my original solution with Sunanda's
explanation idea incorporated:
box: [Box1 Box2 Box3]
loop number-of-games: 100 [
pick-a: func [what] [copy/part random what 1]
prize: pick-a box
choice1: pick-a box
remaining-box: exclude box opened-box: exclude box union prize
choice2: pick-a remaining-box
if win: equal? prize choice2 [
wins: wins + 1
print join "I choose " [
choice1 ". " opened-box " opened. I switch to "
choice2 ". Prize in " prize ". I "
either win ["win"]["lose"] "."
print wins / number-of-games
> I'm then going to go see if they can do the same in Pearl, or language of
The choice of variable name is going to impact on the goal of the smallest
For this goal I believe one should use a meaningful name - something that
does not require a legend to understand it
immediately in it's own context.