summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2020-06-21 16:21:31 -0400
committerrsiddharth <s@ricketyspace.net>2020-06-21 16:21:31 -0400
commit4dcbd72a4d0421581b581957f7c9a95cf9bf975b (patch)
tree592fdc3461b88ec98ce948785bad1cf8f6b779da
parent48fb1ff7f5dd064068d4dc07e1a3cbb523d7347d (diff)
net/ricketyspace/ror/thirteen/server.rkt: Update handle-msg-guesser
-rw-r--r--net/ricketyspace/ror/thirteen/server.rkt10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/ricketyspace/ror/thirteen/server.rkt b/net/ricketyspace/ror/thirteen/server.rkt
index 2e57867..12ff10a 100644
--- a/net/ricketyspace/ror/thirteen/server.rkt
+++ b/net/ricketyspace/ror/thirteen/server.rkt
@@ -90,14 +90,14 @@
[clients (server-state-clients u)]
[done (server-state-done u)])
(server-state interval clue guess paction "c" clients done)))
- (define (set-gaction-guess)
+ (define (set-gaction gaction)
(let ([interval (server-state-interval u)]
[clue (server-state-clue u)]
[guess (server-state-guess u)]
[paction (server-state-paction u)]
[clients (server-state-clients u)]
[done (server-state-done u)])
- (server-state interval clue guess paction "g" clients done)))
+ (server-state interval clue guess paction gaction clients done)))
(define (has-clue)
(> (string-length (server-state-clue u)) 0))
(define (is-done)
@@ -112,7 +112,9 @@
[done (server-state-done u)]
[action-ok (string=? (server-state-gaction u) action)])
(cond [(not action-ok) (make-bundle u empty (list client))]
- [(is-done) (make-bundle u (mail "" current-guess "" #t) empty)]
+ [(is-done)
+ (make-bundle (set-gaction "")
+ (mail "" current-guess "" #t) empty)]
[(and (string=? action "g") (not (has-clue)))
(let ([guess (guess interval)])
(make-bundle (set-guess interval "" guess)
@@ -123,7 +125,7 @@
(make-bundle (set-guess n-interval "" guess)
(mail "" guess "c" done) empty))]
[(and (string=? action "c") (has-clue))
- (make-bundle (set-gaction-guess)
+ (make-bundle (set-gaction "g")
(mail clue current-guess "g" done) empty)]
[else (make-bundle u (mail clue current-guess action done)
empty)])))