Last active
March 18, 2017 14:16
-
-
Save deque-blog/5ae997cb7f795f12f9f985cd2c1b23b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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