diff --git a/gib-gab-gob/game.scm b/gib-gab-gob/game.scm index 2251e6a..ce6b623 100644 --- a/gib-gab-gob/game.scm +++ b/gib-gab-gob/game.scm @@ -23,9 +23,10 @@ (syscaller-free-fiber (λ () (put-message state+ (%state)))) #f) (define (switch-turn!) - ($ %my-turn? (not %my-turn?)) - (when ($ %my-turn?) (signal-turn)) - #f) + (let ((new-turn (not ($ %my-turn?)))) + ($ %my-turn? new-turn) + (when new-turn (signal-turn)) + #f)) (when first? (signal-turn)) (methods ;; The peer is telling us about the turn it took. diff --git a/gib-gab-gob/ui/console.scm b/gib-gab-gob/ui/console.scm index 0495b9e..e4fd85b 100644 --- a/gib-gab-gob/ui/console.scm +++ b/gib-gab-gob/ui/console.scm @@ -15,6 +15,8 @@ #:use-module (goblins ocapn netlayer onion) #:export (make-initiator make-joiner)) +(random-state-from-platform) + ;; Module for simple console-based UI (no curses) ;; A single run of the loop for a bespoke REPL for playing the game