diff options
author | elioat <hi@eli.li> | 2023-12-17 12:10:51 -0500 |
---|---|---|
committer | elioat <hi@eli.li> | 2023-12-17 12:10:51 -0500 |
commit | ec99dee75445f01e6dd15fc1de9eca26eca41df7 (patch) | |
tree | 9b619cbea4cb97319c07f84827a708a3e1992904 | |
parent | 5464c7fac60f5f98644d848a0cb2f4b949031146 (diff) | |
download | december-2023-ec99dee75445f01e6dd15fc1de9eca26eca41df7.tar.gz |
*
-rw-r--r-- | scratch/game.brev | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/scratch/game.brev b/scratch/game.brev index 5b46a72..207f968 100644 --- a/scratch/game.brev +++ b/scratch/game.brev @@ -1,5 +1,4 @@ (import brev mdg) -(import simple-loops) (define true #t) (define false #f) @@ -24,9 +23,15 @@ ; (listner game-running)) ; (loop)) -(let ((n 4) (lst '())) - (do-while (<= 0 n) - (set! lst (cons n lst)) - (set! n (- n 1))) - (print "n "n) - lst) \ No newline at end of file +(define-syntax while + (syntax-rules () + ((while cond body ...) + (let loop () + (when cond + body ... + (loop)))))) + +(let ((str "PENCHANT") (i 0)) + (while (< i (string-length str)) + (print (string-ref str i)) + (set! i (add1 i)))) \ No newline at end of file |