 ;; - But, if the move wasn’t valid, we iterate with the "current" board and the
 ;;   :wait action. In other words, we’ll keep waiting for a valid move.
 
-(let [keys (keys-chan)]
-  (go-loop [board (initial-board (build-tile) (build-tile))
+(let [keys (keys-chan)
+      build-rand-tile build-tile]
+  (go-loop [board (initial-board (build-rand-tile) (build-rand-tile))
             action :render]
     (case action
       :render (do (render board :slide)

  "Performs a new move on board in the given direction after removing transient
   data from the tiles (:new and :src keys). Returns the new board, or nil when
   no change occurs."
  [board direction]
  (move build-tile (map #(dissoc % :new :src) board) direction))

;; The player will make moves by pressing the arrow keys. Instead of registering
;; callbacks to handle keyup events, we’ll convert them to a core.async’s

                  (<! (timeout 100))
                  (when-not (ended? board)
                    (recur board :wait)))
      :wait (if-let [board' (handle-move board (build-rand-tile) (<! keys))]
              (recur board' :render)
              (recur board :wait)))))
