about summary refs log tree commit diff stats
path: root/scratch/game.brev
blob: 207f968ad993884af6d6c041f440c55742df267b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
(import brev mdg)

(define true #t)
(define false #f)
(define game-running true)

(define (menu msg)
	(print msg))

(define start-game "start game")
(define game-over "game over")

; (define (listner game-running)
; 	(display " > ")
; 	(define user-input (read))
; 	(if (string=? user-input "quit")
; 		(set! game-running false)
; 		(print user-input))
; 	game-running)

; (let loop ()
; 	(if (eqv? game-running true)
; 		(listner game-running))
; 	(loop))

(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))))