I am having some problems with a project and was hoping you could help.
I have some clojure functions like
(def player-grid {:width {} :height {}})
(defn contains-coord [grid x y]
(if ((and (= ((grid :width) x) x) (= ((grid :height) y) y)))
true
false))
(defn add-to-grid [grid x y]
(assoc grid :width (into (grid :width) {x x})
:height (into (grid :height) {y y})))
and I also have a html page that has a 10X10 battleship game board made of checkboxes. I have tried to find a way to connect the two so that when I click on the board to put a ship the coordinates are sent to the clojure function.
Basically, I have no idea how to put the two together to work as a whole.
I'd really appreciate some advice or example on this matter since I found nothing useful when using compojure and hiccup except for creating new html pages from scratch.