 
 (defn neighbor-bombs [board i j]
   (->> (neighbors board i j)
-       (filter bomb?)
+       (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 r]
-          (mapv (fn [space c]
-                  (let [b? (bomb? space)]
-                    {:bomb? b?
-                     :revealed? false
-                     :count (when-not b? (neighbor-bombs board r c))
-                     :path [r c]}))
-                row (range))) board (range)))
+  (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
   ([]


(comment

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

)

                            s)) row)) board))

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

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