1
0
Fork 0

Switch to ~a to avoid quotes in name.

This commit is contained in:
Vivianne 2023-02-05 23:34:59 -08:00
parent efe8e786c3
commit aa89fc61a9
2 changed files with 3 additions and 3 deletions

View File

@ -13,7 +13,7 @@
(format #t "Hey there, ~a! You sent me your pick of rock-paper-scissors; now I will send mine.\n" name)
(on (<- (<- client 'pick->unsealer pick) sealed-pick)
(lambda (peer-pick)
(format #t "Opponent ~s has picked ~a (do I win? ~s)\n" name peer-pick (rps-winner pick peer-pick))))]))
(format #t "Opponent ~a has picked ~a (do I win? ~a)\n" name peer-pick (rps-winner pick peer-pick))))]))
(define (^client-picker bcom)
(define-values (seal-pick unseal-pick my-pick?)
@ -22,5 +22,5 @@
(methods
[(get-sealed-pick) ($ seal-pick pick)]
[(pick->unsealer peer-pick)
(format #t "Peer picked ~a... a bold choice (do I win? ~s), I will send my unsealer\n" peer-pick (rps-winner pick peer-pick))
(format #t "Peer picked ~a... a bold choice (do I win? ~a), I will send my unsealer\n" peer-pick (rps-winner pick peer-pick))
unseal-pick]))

View File

@ -52,7 +52,7 @@
(define client-picker (spawn ^client-picker))
(on (<- (lobby client) 'register-opponent user-name client-picker ($ client-picker 'get-sealed-pick))
(lambda (_)
(format #t "~s finished the game.\n" user-name)))))
(format #t "~a finished the game.\n" user-name)))))
;;
;; Standard rock paper scissors logic follows!