Two bullet roulette: Difference between revisions
→{{header|EasyLang}}
(→{{header|Vlang}}: Rename "Vlang" in "V (Vlang)") |
|||
Line 453:
=={{header|EasyLang}}==
{{trans|C}}
<syntaxhighlight lang="text">
len cyl[] 6
func rshift . .
h = cyl[
for i =
cyl[i] = cyl[i - 1]
.
cyl[
.
func unload . .
for i
cyl[i] = 0
.
.
func load . .
while cyl[
call rshift
.
cyl[
call rshift
.
func spin . .
lim = random 6
for i = 1 to lim - 1
call rshift
Line 480 ⟶ 481:
.
func fire . shot .
shot = cyl[
call rshift
.
Line 487 ⟶ 488:
shot = 0
for m in m[]
if m =
call load
elif m =
call spin
elif m =
call fire shot
if shot = 1
Line 502 ⟶ 503:
func test m[] . .
n = 100000
for i
call method m[] shot
sum += shot
.
for
write method$[m[i]] & " "
.
print "-> " & 100 * sum / n & "%
.
call test [
call test [
call test [
call test [
</syntaxhighlight>
=={{header|Factor}}==
|