1. Q: Sunanda wrote: To compare like with like, other programs shou;d
exactly replicate the format 
of the printed lines.
A: We agree!

Very nicely done.  Actually "simulates" the problem.
Several others have written good versions as well.
Brett's for example.

It is rare, even on this mailing group, that we can all try our hand at the
same basic problem.  Of course even in the same language there are infinite
numbers of ways to express oneself.  But this is what makes this so useful.


I have grabbed a chunk of these emails for others (friends I'm slowly
convincing to join the alliance) so they can learn faster.

Coincidently, I'm currently working on a product I designed which will
eventually become a new slot game in Vegas (and other gaming places).

I have been doing combinatory statistics for the past 2 weeks.  
One of the mathematicians is working on Linux, and our front end is in
Director PC.
It would be SOOOOOOOOO much easier if everything were just Rebol.  
But both sides have their own problems.  Rebol crashes on the Linux side,
and the Director programmer (lingo) will NOT learn a new language.

I'm slowly chipping away at the linux guy.  Trying to get him to accept that
Rebol is so great that he shouyld try to figure out why it crashes on his
machine.

Reichart...
[EMAIL PROTECTED]
"Be useful."


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, December 18, 2001 3:22 AM
To: [EMAIL PROTECTED]
Subject: [REBOL] Re: A Rebol Challenge. The Monty Hall Puzzle IN 0 BY TES

Hi Riechart,

> But the goal is to not keep making the example shown with the C, MatLab,
and
>  Pearl smaller, but to make a more verbose accurate portrayal of the 
original
>  puzzle in Rebol.
>  
>  I'm then going to go see if they can do the same in Pearl, or language of
>  choice.

Okay, I'm game.

Here's a version of the Monty Simulator that plays the game 100 times, and 
prints the result for each play, and a final total. Our competitor swaps
each 
time.

To compare like with like, other programs shou;d exactly replicate the
format 
of the printed lines.

The program as presented is about 350 bytes I reserve the right to reduce it

to under 250 bytes for a "final version". I am also fairly confident that I 
can do a full GUI implementation in under 1K

Rebol []
N: 100
Loop N [

   D:  random/secure [Red Green Blue]
   C:  pick D random 3
   prin["I pick"D/1]
   M: next D

   if find M C[alter M C]

   prin[". M shows"M/1]
   either 1 = length? M [prin [". I swap to"C]]
                        [prin [". I swap to"M/2]]

   prin[". Car was behind" C]
   either  D/1 = C
           [print ". I lose."N: N - 1]
           [Print ". I win."]

]
print ["Wins:" N]


Notes on variables:

D - for Doors array
C - colour of door that hides the car
M - for Monty's two doors
N for loop count and wins (using Ryan's ingenious two-for-the-price of one 
trick)

Print line format is:

I pick [col]. M shows [col]. I swap to [col]. Car was behind [col]. I 
[win/lose].

where [col] = colour name.


last line:

wins: nn


Sunanda.
-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.
-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to