 
   let model: GameModel
   
-  var board: GameboardView?
-  var scoreView: ScoreViewProtocol?
+  weak var board: GameboardView!
+  weak var scoreView: ScoreView!
 
   // Width of the gameboard
   let boardWidth: CGFloat = 230.0

  }

  func reset() {
    assert(board != nil)
    let b = board!
    b.reset()
    model.reset()
    model.insertTileAtRandomLocation(2)
    model.insertTileAtRandomLocation(2)

        }
      })
  }
}

extension NumberTileGameViewController: GameModelProtocol {
  func scoreChanged(score: Int) {
    scoreView.scoreChanged(newScore: score)
  }

  func moveOneTile(from: (Int, Int), to: (Int, Int), value: Int) {
    board.moveOneTile(from, to: to, value: value)
  }

  func moveTwoTiles(from: ((Int, Int), (Int, Int)), to: (Int, Int), value: Int) {
    board.moveTwoTiles(from, to: to, value: value)
  }

  func insertTile(location: (Int, Int), value: Int) {
    board.insertTile(location, value: value)
  }
}
