Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^10: Marilyn Vos Savant's Monty Hall problem

by BrowserUk (Patriarch)
on Aug 23, 2004 at 23:28 UTC ( [id://385264]=note: print w/replies, xml ) Need Help??


in reply to Re^9: Marilyn Vos Savant's Monty Hall problem
in thread Marilyn Vos Savant's Monty Hall problem

How about ?

my $MontysChoice; if( $doors[ choice ] ne 'car' ) { $MontysChoice = grep{ $doors[ $_ ] eq 'car' } 0 .. 2; } else { $MontysChoice = ( grep{ $_ != $choice } 0 .. 2 )[ rand 2 ]; }

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://385264]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-20 05:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found