Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
(defn move-piece [board old-pos new-pos]
(let [moving-piece (get-in board old-pos)]
(reduce (fn [acc [ks v]] (assoc-in acc ks v)),
board, [[old-pos nil] [new-pos moving-piece]])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.