Monty Hall problem: Difference between revisions

m
→‎{{header|XPL0}}: Output statements together.
(→‎{{header|XPL0}}: The procedure Play replaced by a pure function.)
m (→‎{{header|XPL0}}: Output statements together.)
Line 5,180:
 
[Format(2,1);
Text(0, "NOT switching doors wins car in ");
NWins:= 0;
for Game:= 0 to NGames-1 do
if IsGameWon(false) then NWins:= NWins+1;
Text(0, "NOT switching doors wins car in ");
RlOut(0, float(NWins)/float(NGames)*100.0);
Text(0, "% of games.^M^J");
 
Text(0, "But switching doors wins car in ");
NWins:= 0;
for Game:= 0 to NGames-1 do
if IsGameWon(true) then NWins:= NWins+1;
Text(0, "But switching doors wins car in ");
RlOut(0, float(NWins)/float(NGames)*100.0);
Text(0, "% of games.^M^J");
512

edits