 
 (comment
 
-(println (print-board (generate-board 5 7 10)))
+(println (print-board (generate-board 7 7 10)))
 
 )

                            s)) row)) board))

(defn print-board [board]
  (str/join "\n" (map #(apply str (map space->str %)) board)))

(defn reveal-coords [board coords]
  (let [propogated (propogated-coordinates board coords)]


(defn neighbor-bombs [board i j]
  (->> (neighbors board i j)
       (filter :bomb?)
       count))

;; Board generation

(defn random-tuples [x y]
  (repeatedly #(vector (rand-int x) (rand-int y))))

(defn add-bombs [board c]
  (let [w (count board)
        h (count (first board))
        coords (take c (distinct (random-tuples w h)))]
    (reduce (fn [b coord]
              (assoc-in b (conj coord :bomb?) true)) board coords)))

(defn annotate [board]
  (mapv (fn [row]
          (mapv (fn [{:keys [bomb? path] :as space}]
                  (assoc space
                         :revealed? false
                         :count (when-not bomb?
                                  (apply neighbor-bombs board path))))
                row))
        board))

(defn generate-base [w h]
  (mapv (fn [x]
          (mapv (fn [y] {:path [x y]}) (range w)))
        (range h)))

(defn generate-board
  ([]
