Data update

This commit is contained in:
Ingy döt Net 2023-09-16 17:28:03 -07:00
parent 5af6d93694
commit 796d366b97
455 changed files with 7413 additions and 1900 deletions

View file

@ -13,50 +13,49 @@ proc unload . .
.
proc load . .
while cyl[1] = 1
call rshift
rshift
.
cyl[1] = 1
call rshift
rshift
.
proc spin . .
lim = random 6
for i = 1 to lim - 1
call rshift
rshift
.
.
proc fire . shot .
func fire .
shot = cyl[1]
call rshift
rshift
return shot
.
proc method m[] . shot .
call unload
shot = 0
func method m[] .
unload
for m in m[]
if m = 1
call load
load
elif m = 2
call spin
spin
elif m = 3
call fire shot
if shot = 1
break 1
if fire = 1
return 1
.
.
.
return 0
.
method$[] = [ "load" "spin" "fire" ]
proc test m[] . .
n = 100000
for i = 1 to n
call method m[] shot
sum += shot
sum += method m[]
.
for i = 1 to len m[]
write method$[m[i]] & " "
.
print "-> " & 100 * sum / n & "% death"
.
call test [ 1 2 1 2 3 2 3 ]
call test [ 1 2 1 2 3 3 ]
call test [ 1 1 2 3 2 3 ]
call test [ 1 1 2 3 3 ]
test [ 1 2 1 2 3 2 3 ]
test [ 1 2 1 2 3 3 ]
test [ 1 1 2 3 2 3 ]
test [ 1 1 2 3 3 ]