>"weil die Zwerge während des Gesamten Spiels keinerlei Informationen (direkt oder indirekt) weitergeben dürfen."
> Dabei ist mir erst aufgefallen, dass ein fündig gewordener Zwerg seine Mütze mitnimmt.
var loc : array[1..100] of integer;
games, wins: integer;
prob: real;
procedure NewGame;
var i, j, k, tmp: integer;
begin
for i:=1 to 100 do loc:=i;
Randomize;
for i:=1 to 1000 do begin
j:=1+Random(100); //1..100
k:=1+Random(100); //1..100
tmp:=loc[j];
loc[j]:=loc[k];
loc[k]:=tmp;
end;
end;
function Mission(player: integer): Boolean;
var where, counter: integer;
begin
where:=player;
counter:=0;
repeat
inc(counter);
if counter>50 then begin result:=false; exit; end;
if loc[where]=player then begin result:=true; exit; end; //success
where:=loc[where];
until false ;
end;
function Game: Boolean;
var player: integer;
begin
NewGame;
result:=false;
for player:=1 to 100 do begin
if not Mission(player) then exit;
end;
result:=true;
end;
begin //main
writeln('Locker Puzzle simulation EVCOMP 2016');
wins:=0;
for games:=1 to 100000 do begin
if Game then inc(wins);
prob:=wins/games;
if (games mod 1000)=0 then writeln(Format('Games %7d Prob %1.5f',[games, prob]));
end;
end.
Locker Puzzle simulation EVCOMP 2016
Games 1000 Prob 0,30900
Games 2000 Prob 0,31550
Games 3000 Prob 0,31467
Games 4000 Prob 0,31075
Games 5000 Prob 0,31280
Games 6000 Prob 0,30950
Games 7000 Prob 0,31314
Games 8000 Prob 0,31000
Games 9000 Prob 0,30844
Games 10000 Prob 0,31120
Games 11000 Prob 0,31100
Games 12000 Prob 0,30983
Games 13000 Prob 0,30962
Games 14000 Prob 0,31129
Games 15000 Prob 0,31247
Games 16000 Prob 0,31269
Games 17000 Prob 0,31194
Games 18000 Prob 0,31261
Games 19000 Prob 0,31395
Games 20000 Prob 0,31405
Games 21000 Prob 0,31343
Games 22000 Prob 0,31368
Games 23000 Prob 0,31361
Games 24000 Prob 0,31388
Games 25000 Prob 0,31316
Games 26000 Prob 0,31250
Games 27000 Prob 0,31148
Games 28000 Prob 0,31107
Games 29000 Prob 0,31148
Games 30000 Prob 0,31143
Games 31000 Prob 0,31139
Games 32000 Prob 0,31159
Games 33000 Prob 0,31094
Games 34000 Prob 0,31079
Games 35000 Prob 0,31080
Games 36000 Prob 0,31114
Games 37000 Prob 0,31051
Games 38000 Prob 0,31034
Games 39000 Prob 0,31051
Games 40000 Prob 0,31093
Games 41000 Prob 0,31059
Games 42000 Prob 0,31088
Games 43000 Prob 0,31084
Games 44000 Prob 0,31145
Games 45000 Prob 0,31162
Games 46000 Prob 0,31213
Games 47000 Prob 0,31194
Games 48000 Prob 0,31219
Games 49000 Prob 0,31194
Games 50000 Prob 0,31184
Games 51000 Prob 0,31204
Games 52000 Prob 0,31229
Games 53000 Prob 0,31245
Games 54000 Prob 0,31230
Games 55000 Prob 0,31220
Games 56000 Prob 0,31239
Games 57000 Prob 0,31282
Games 58000 Prob 0,31302
Games 59000 Prob 0,31305
Games 60000 Prob 0,31302
Games 61000 Prob 0,31275
Games 62000 Prob 0,31263
Games 63000 Prob 0,31268
Games 64000 Prob 0,31256
Games 65000 Prob 0,31232
Games 66000 Prob 0,31233
Games 67000 Prob 0,31285
Games 68000 Prob 0,31243
Games 69000 Prob 0,31243
Games 70000 Prob 0,31213
Games 71000 Prob 0,31224
Games 72000 Prob 0,31218
Games 73000 Prob 0,31212
Games 74000 Prob 0,31216
Games 75000 Prob 0,31244
Games 76000 Prob 0,31254
Games 77000 Prob 0,31277
Games 78000 Prob 0,31272
Games 79000 Prob 0,31275
Games 80000 Prob 0,31296
Games 81000 Prob 0,31311
Games 82000 Prob 0,31318
Games 83000 Prob 0,31313
Games 84000 Prob 0,31315
Games 85000 Prob 0,31342
Games 86000 Prob 0,31295
Games 87000 Prob 0,31279
Games 88000 Prob 0,31249
Games 89000 Prob 0,31224
Games 90000 Prob 0,31194
Games 91000 Prob 0,31223
Games 92000 Prob 0,31207
Games 93000 Prob 0,31199
Games 94000 Prob 0,31205
Games 95000 Prob 0,31216
Games 96000 Prob 0,31203
Games 97000 Prob 0,31193
Games 98000 Prob 0,31191
Games 99000 Prob 0,31208
Games 100000 Prob 0,31206
Powered by mwForum 2.29.3 © 1999-2014 Markus Wichitill