 
 (def ^:dynamic *speculative* false)
 
-;; TODO: make cycles of size 2 work (approach: become aware of the turn they were played on)
 ;; TODO: make hover highlighting work (approach: third top-level activity)
 ;; TODO: make cycle collapse work
 

           :turn (:turn game)
           :focus true})))))

(defn play
  "Play an action at the given cell and subcell.
   What the action is depends on the game context."
  [game cell subcell]
  (if (:collapsing game)
    (resolve-collapse game cell subcell)
    (spooky-mark game cell subcell)))

(defn speculate
  "Make a play, but store the previous game state so the 'play' can be easily reverted"

        (reduce (fn [g cell]
                  (let [collapsing-subcells
                        (keep
                          (fn [[sub e]] (when (contains? collapsing-cells (first (:pair e))) sub))
                          (get-in g [:board cell :entanglements]))]
                    (reduce #(assoc-in %1 [:board cell :entanglements %2 :collapsing] true) g collapsing-subcells)))
          (assoc game :collapsing true)
