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,23 @@
$ include "seed7_05.s7i";
const proc: main is func
local
var integer: switchWins is 0;
var integer: stayWins is 0;
var integer: winner is 0;
var integer: choice is 0;
var integer: shown is 0;
var integer: plays is 0;
begin
for plays range 1 to 10000 do
winner := rand(1, 3);
choice := rand(1, 3);
repeat
shown := rand(1, 3)
until shown <> winner and shown <> choice;
stayWins +:= ord(choice = winner);
switchWins +:= ord(6 - choice - shown = winner);
end for;
writeln("Switching wins " <& switchWins <& " times");
writeln("Staying wins " <& stayWins <& " times");
end func;