From 6dda086d5ccfd194d8fbb51b8d10461605e43c79 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Thu, 23 Dec 2021 13:56:32 -0500 Subject: [PATCH] day23: track games in set, not vector --- day23/core.clj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/day23/core.clj b/day23/core.clj index d04a614..213ce5e 100644 --- a/day23/core.clj +++ b/day23/core.clj @@ -74,7 +74,7 @@ nil])) (defn do-turns [fields] - (into [] + (into #{} (r/fold r/cat #(if-let [t (apply do-slot %2)] @@ -92,7 +92,7 @@ (do (println "Splitting...") (doseq [p (partition 50000 turns)] - (play-games (into [] p) tc))) + (play-games (into #{} p) tc))) (do (let [new-turns (do-turns turns) winners (filter winner? new-turns)] @@ -106,6 +106,6 @@ (defn -main "I don't do a whole lot ... yet." [& args] - (play-games [[init-field 0]] 0) + (play-games #{[init-field 0]} 0) (println (first (sort @wins))))