Fixing crashes caused by misunderstanding cond
This commit is contained in:
parent
3e9d075cda
commit
43b7b94397
2 changed files with 4 additions and 4 deletions
|
@ -14,8 +14,8 @@
|
|||
(define %my-turn? first?)
|
||||
(define (%state)
|
||||
(cond
|
||||
((board-winner? board mark) => 'won)
|
||||
((board-winner? board peer-mark) => 'lost)
|
||||
((board-winner? board mark) 'won)
|
||||
((board-winner? board peer-mark) 'lost)
|
||||
(else 'play)))
|
||||
(define (signal-turn)
|
||||
;; any better way to do this?
|
||||
|
|
|
@ -54,8 +54,8 @@
|
|||
(define (%display b state)
|
||||
(board-display b)
|
||||
(cond
|
||||
((eq? state 'won) => (format #t "*** I won! ***\n"))
|
||||
((eq? state 'lost) => (format #t "*** I lost! ***\n"))))
|
||||
((eq? state 'won) (format #t "*** I won! ***\n"))
|
||||
((eq? state 'lost) (format #t "*** I lost! ***\n"))))
|
||||
|
||||
(define (begin-game-loop board controller my-turn+)
|
||||
(define vat (spawn-vat #:name "UI"))
|
||||
|
|
Loading…
Reference in a new issue