lambdaize
This commit is contained in:
parent
d39811d38e
commit
3ce3051bef
1 changed files with 2 additions and 3 deletions
|
@ -33,7 +33,7 @@
|
|||
[(register-opponent name peer sealed-pick)
|
||||
(format #t "Hey there, ~a! You sent me your pick of rock-paper-scissors; now I will send mine.\n" name)
|
||||
(on (<- (<- peer 'pick->unsealer pick) sealed-pick)
|
||||
(lambda (peer-pick)
|
||||
(λ (peer-pick)
|
||||
(define won? (rps-winner pick peer-pick))
|
||||
(format #t "Opponent ~a has picked ~a (do I win? ~a). Time to be a controller.\n" name peer-pick won?)
|
||||
(bcom (^game-controller bcom won? peer))))]))
|
||||
|
@ -51,8 +51,7 @@
|
|||
(define lobby ($ mycapn 'enliven lobby-sref))
|
||||
(define client-picker (spawn ^client-picker lobby ^game-controller))
|
||||
(on (<- lobby 'register-opponent user-name client-picker ($ client-picker 'get-sealed-pick))
|
||||
(lambda (_)
|
||||
(format #t "~a finished the game.\n" user-name)))))
|
||||
(λ (_) (format #t "~a finished the game.\n" user-name)))))
|
||||
|
||||
(define (^client-picker bcom lobby ^game-controller)
|
||||
(define-values (seal-pick unseal-pick my-pick?)
|
||||
|
|
Loading…
Reference in a new issue