diff options
Diffstat (limited to 'net/ricketyspace')
-rw-r--r-- | net/ricketyspace/ror/fourteen/server.rkt | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/ricketyspace/ror/fourteen/server.rkt b/net/ricketyspace/ror/fourteen/server.rkt index 8088b40..55d5f7b 100644 --- a/net/ricketyspace/ror/fourteen/server.rkt +++ b/net/ricketyspace/ror/fourteen/server.rkt @@ -301,7 +301,14 @@ The server is responsible for: ;; moves all objects. may end game (define (progress pls foods spectators) (define p (play pls foods spectators)) - (cond [(empty? foods) (end-game-broadcast p)] + (define (max-score) + (foldl (λ (pl max) + (let ([pl-score (cadr pl)]) + (if (> pl-score max) pl-score max))) + 0 (score pls))) + (define (end-game?) + (or (empty? foods) (> (max-score) 30))) + (cond [(end-game?) (end-game-broadcast p)] [else (broadcast-universe p)])) ;; PlayUniverse -> [Bundle JoinUniverse] |