 
 (println (str "Reloaded: " (.toLocaleTimeString (js/Date.))))
 
-(def init-pieces
+(defonce init-pieces
   [[\u265C \u265E \u265D \u265B \u265A \u265D \u265E \u265C]
    [\u265F \u265F \u265F \u265F \u265F \u265F \u265F \u265F]
    ["" "" "" "" "" "" "" ""]

  {:text-align "center"
   :font-size (*
               (min (:height data) (:width data))
               0.07)})

(defn slider-view
  "adjusts the size of the board"

   [\u2659 \u2659 \u2659 \u2659 \u2659 \u2659 \u2659 \u2659]
   [\u2656 \u2658 \u2657 \u2655 \u2654 \u2657 \u2658 \u2656]])

(defonce init-colors
  (vec
   (take 8 (cycle [(vec (take 8 (cycle '("#a3854b" "#d3d2cf"))))
                   (vec (take 8 (cycle '("#d3d2cf" "#a3854b"))))]))))

(defn string-mapping
  "given a list of rows and cols and a string list
  creates the string mapping"
  [rows cols strings]
  (zipmap
   (map char
        strings)
   (for [y rows
         x cols]
     [y x])))

(def init-state
  {:width 500
   :height 500
   :board
