Fixing crashes caused by misunderstanding cond

This commit is contained in:
Vivianne 2023-07-09 22:59:29 -07:00
parent 3e9d075cda
commit 43b7b94397
2 changed files with 4 additions and 4 deletions

View file

@ -14,8 +14,8 @@
(define %my-turn? first?) (define %my-turn? first?)
(define (%state) (define (%state)
(cond (cond
((board-winner? board mark) => 'won) ((board-winner? board mark) 'won)
((board-winner? board peer-mark) => 'lost) ((board-winner? board peer-mark) 'lost)
(else 'play))) (else 'play)))
(define (signal-turn) (define (signal-turn)
;; any better way to do this? ;; any better way to do this?

View file

@ -54,8 +54,8 @@
(define (%display b state) (define (%display b state)
(board-display b) (board-display b)
(cond (cond
((eq? state 'won) => (format #t "*** I won! ***\n")) ((eq? state 'won) (format #t "*** I won! ***\n"))
((eq? state 'lost) => (format #t "*** I lost! ***\n")))) ((eq? state 'lost) (format #t "*** I lost! ***\n"))))
(define (begin-game-loop board controller my-turn+) (define (begin-game-loop board controller my-turn+)
(define vat (spawn-vat #:name "UI")) (define vat (spawn-vat #:name "UI"))