Anonymous user
Monty Hall problem: Difference between revisions
→{{header|PureBasic}}: corrected trial count and results (results now = 100%)
(→{{header|AutoHotkey}}: Fixed AHK output (it was only run for 100 when I added the output)) |
(→{{header|PureBasic}}: corrected trial count and results (results now = 100%)) |
||
Line 1,080:
=={{header|PureBasic}}==
<lang PureBasic>
stay.i
redecide.i
EndStructure
Procedure MontyHall(*results.wins)
Dim Doors(2)
Doors(Random(2)) = 1
Open = Doors(0)
*results\redecide
▲ ProcedureReturn Doors(2)
EndProcedure
OpenConsole()
#Tries = 1000000
Define results.wins
For
Next
PrintN("Trial runs for each option: " + Str(#Tries))
PrintN("Wins when redeciding: " + Str(
PrintN("Wins when sticking: " + Str(
Input()</lang>
Output:<pre>Trial runs for each option: 1000000
Wins when redeciding:
Wins when sticking:
=={{header|Python}}==
|