Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,19 @@
procedure main(arglist)
rounds := integer(arglist[1]) | 10000
doors := '123'
strategy1 := strategy2 := 0
every 1 to rounds do {
goats := doors -- ( car := ?doors )
guess1 := ?doors
show := goats -- guess1
if guess1 == car then strategy1 +:= 1
else strategy2 +:= 1
}
write("Monty Hall simulation for ", rounds, " rounds.")
write("Strategy 1 'Staying' won ", real(strategy1) / rounds )
write("Strategy 2 'Switching' won ", real(strategy2) / rounds )
end