Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active March 18, 2017 14:16
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save deque-blog/5ae997cb7f795f12f9f985cd2c1b23b4 to your computer and use it in GitHub Desktop.
(def relative-size 0.9)
(def border-size (/ (- 1 relative-size) 2))
(defn- rect-cell
[[x y] player options]
[:rect.cell
(merge
{:class (str "cell--" (name player))
:x (+ border-size x) :width relative-size
:y (+ border-size y) :height relative-size}
options)])
(defn- empty-cell
[[x y :as position] interactions player]
(rect-cell position player
{:on-click #(i/on-player-move interactions x y)}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment