21 game: Difference between revisions
1-based index
(→{{header|Vlang}}: Rename "Vlang" in "V (Vlang)") |
(1-based index) |
||
Line 2,291:
<syntaxhighlight lang="text">print "Who reaches 21, wins"
print "Do you want to begin (y/n)"
who = 1
if input = "n"
who =
.
who$[] = [ "Human" "Computer" ]
repeat
if who =
repeat
print ""
Line 2,307 ⟶ 2,308:
sleep 1
if sum mod 4 = 1
n = random 3
else
n = 4 - (sum + 3) mod 4
Line 2,315 ⟶ 2,316:
print who$[who] & ": " & n & " --> " & sum
until sum >= 21 or a$ = "q"
who =
.
if a$ <> "q"
|