Data update

This commit is contained in:
Ingy döt Net 2026-04-30 12:34:36 -04:00
parent 4bb20c9b71
commit cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions

View file

@ -0,0 +1,31 @@
!YS-v0
players =: qw(A B):cycle.drop(rand-int(2))
defn main():
say: |
--------------------
Welcome to 21 Game
--------------------
loop turn 0 total 0:
say: "Running total: $total"
say: "Player $(players.$turn)'s turn"
total +=: get-num(total)
say:
when total == 21:
say: |
Running total is 21. Player $(players.$turn) won!
exit: 0
recur: turn.++ total
defn get-num(total):
print: 'Enter a number (1,2,3): '
val =: read-line()
condf val:
nil?: exit()
\(/[1-3]/):
if (total + val:N) > 21:
recur()
val
else: recur()