From 20f5950d0444041185fda6f6ab515f5cf89a358e Mon Sep 17 00:00:00 2001 From: James Williams <51956016+jamesreprise@users.noreply.github.com> Date: Mon, 11 Dec 2023 20:40:18 +0000 Subject: [PATCH] feat: use update where appropriate --- server/project.clj | 1 + server/src/mfc/game.clj | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/project.clj b/server/project.clj index 62a36cc..c7035dd 100644 --- a/server/project.clj +++ b/server/project.clj @@ -3,6 +3,7 @@ :license {:name "GNU AGPL v3" :url "https://www.gnu.org/licenses/agpl-3.0.en.html"} :dependencies [[org.clojure/clojure "1.10.3"] + [org.clojure/core.async "1.6.673"] [org.clojure/core.incubator "0.1.4"] [org.clojure/tools.logging "1.2.4"] [ch.qos.logback/logback-classic "1.4.11"] diff --git a/server/src/mfc/game.clj b/server/src/mfc/game.clj index d67b612..f62949f 100644 --- a/server/src/mfc/game.clj +++ b/server/src/mfc/game.clj @@ -70,10 +70,10 @@ ([game double-info] (cond (>= 3 (:count double-info)) (move-current-player-to game -1) :else (roll game)) - (when (:doubles double-info) (take-turn game {:doubles true :count (inc (:count double-info))})))) + (when (:doubles double-info) (take-turn game (update double-info :count inc))))) (defn increment-turn-counter [game] - (update game :turn + 1)) + (update game :turn inc)) (defn next-player [game] (assoc game :current-player (mod (+ 1 (:current-player game)) (count (:order game)))))