Anonymous user
Monty Hall problem: Difference between revisions
→{{header|Perl}}
Line 797:
my $stay = 0;
my $switch = 0;
my $show;▼
foreach (1 .. $trials)
Line 808 ⟶ 806:
if ( $prize == $chosen )
{
▲ my $show;
▲ 1 while( ($show = int(rand 3) ) == $chosen );
# ^ monty opens a door which is not the one with the
# prize, that he knows it is the one the player chosen
|