         pos (position board piece)]
     [(rem pos dim) (quot pos dim)]))
 
-(defn move [board piece]
-  (let [empty-pos (position board 0)
-        pos (position board piece)]
-    (assoc board
-      empty-pos piece
-      pos 0)))
-
-(def dir-delta {:up [0 -1]
-                :down [0 1]
-                :left [-1 0]
-                :right [1 0]})
-
-(defn slide [board arg]
-  (move board (if (contains? dir-delta arg)
-                (move-direction board arg)
-                arg)))
-
-(defn move-direction [board direction]
-  (let [[x y] (coords board 0)
-        [dx dy] (dir-delta direction)
-        coords [(+ x dx) (+ y dy)]]
-    (if (bounded-coords? board coords)
-      (location board coords)
-      0)))
-
 (defn adjacent-coords [board [x y]]
   (let [adj-loc (map (fn [[dx dy]] [(+ x dx) (+ y dy)])
                      (vals dir-delta))]

    mover!))

(comment
  (def move! (main 5)))


(defn solved? [board]
  (= (concat (range 1 (count board)) '(0)) board))

(defn move [board piece]
  (let [empty-pos (position board 0)
        pos (position board piece)]
    (if (can-move? board piece)
      (assoc board
        empty-pos piece
        pos 0)
      board)))

(defn move-direction [board direction]
  (let [[x y] (coords board 0)
        [dx dy] (dir-delta direction)
        coords [(+ x dx) (+ y dy)]]
    (if (bounded-coords? board coords)
      (location board coords)
      0)))

(defn slide [board arg]
  (move board (if (contains? dir-delta arg)
                (move-direction board arg)
                arg)))

(defn path-to [board goal]
  (let [current (coords board 0)]
