 ;; # Moves
 
 ;; The two following functions will make it easier to describe the player moves
-;; using sequences. The first one removes all the nil elements of a sequence.
+;; using collections. The first one removes all the nil elements.
 
 (defn compact
   "Returns a lazy sequence of the items in coll that are not nil."

  [board direction]
  (move build-tile (map #(dissoc % :new :src) board) direction))

;; The player will make moves by pressing the arrow keys. Core.async's channels
;; come in handy when observing events from the DOM. If you are not familiar
;; with core.async there is an excellent introductory
;; [webinar](http://go.cognitect.com/core_async_webinar_recording) by David
;; Nolen. The next two functions were copied from the code examples explained on
;; it. The first can take events from a DOM element and convert them to a
;; channel which we can read from.

(defn events->chan
  "Returns a channel c where the events of event-type that happens on the DOM

       (sort-by :key)))

;; A Game component will wrap SquareBoard and supply it with the tile sequence
;; it expects from a board and a phase. Remember we want to render new and
;; synthesized tiles on the :reveal phase, but not on :slide. The component will
;; also be responsible for showing a message when the game ends.

(q/defcomponent Game
  [{:keys [board phase]}]
