Fix the bcom on the client side. Lobby side still a problem

- Can't use bcom in callbacks
This commit is contained in:
Vivianne 2023-07-03 04:11:06 -07:00
parent 87c6ae831a
commit 610e09b2a6
2 changed files with 5 additions and 3 deletions

View File

@ -34,5 +34,6 @@
(begin (begin
(board-choose! board mark x y) (board-choose! board mark x y)
(set! my-turn? (not my-turn?)) (set! my-turn? (not my-turn?))
(display)) (display)
(<- peer 'peer-turn! x y))
(error "It's not my turn."))])) (error "It's not my turn."))]))

View File

@ -63,8 +63,9 @@
(define won? (rps-winner pick peer-pick)) (define won? (rps-winner pick peer-pick))
(format #t "Peer picked ~a... a bold choice (do I win? ~a), I will become a controller and send my unsealer.\n" peer-pick won?) (format #t "Peer picked ~a... a bold choice (do I win? ~a), I will become a controller and send my unsealer.\n" peer-pick won?)
;; We make the assumption that lobby is to become a controller. ;; We make the assumption that lobby is to become a controller.
(bcom (^game-controller bcom won? lobby)) ;; Note second arg to bcom which will return the value (this is confusing to me)
unseal-pick])) ;; see https://spritely.institute/files/docs/guile-goblins/0.11.0/Object-construction.html
(bcom (^game-controller bcom won? lobby) unseal-pick)]))
;; ;;
;; Standard rock paper scissors logic follows! ;; Standard rock paper scissors logic follows!