From ec99dee75445f01e6dd15fc1de9eca26eca41df7 Mon Sep 17 00:00:00 2001 From: elioat Date: Sun, 17 Dec 2023 12:10:51 -0500 Subject: * --- scratch/game.brev | 19 ++++++++++++------- 1 file 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 -- cgit 1.4.1-2-gfad0