 
   @objc(right:)
   func rightCommand(r: UIGestureRecognizer!) {
-    assert(model != nil)
-    let m = model!
-    m.queueMove(MoveDirection.Right,
+    model.queueMove(MoveDirection.Right,
       completion: { (changed: Bool) -> () in
         if changed {
           self.followUp()


import UIKit

/// A view controller representing the swift-2048 game. It serves mostly to tie a GameModel and a GameboardView
/// together. Data flow works as follows: user input reaches the view controller and is forwarded to the model. Move
/// orders calculated by the model are returned to the view controller and forwarded to the gameboard view, which
/// performs any animations to update its state.
class NumberTileGameViewController : UIViewController, GameModelProtocol {
  // How many tiles in both directions the gameboard contains
  var dimension: Int
  // The value of the winning tile
  var threshold: Int

  var board: GameboardView?
  var model: GameModel?

  var scoreView: ScoreViewProtocol?

  // Width of the gameboard

  // Commands
  @objc(up:)
  func upCommand(r: UIGestureRecognizer!) {
    model.queueMove(MoveDirection.Up,
      completion: { (changed: Bool) -> () in
        if changed {
          self.followUp()
