public void addRandomTile() { if (grid.isCellsAvailable()) { int value = Math.random() < 0.9 ? 2 : 4; Tile tile = new Tile(grid.randomAvailableCell(), value); spawnTile(tile); } }
public boolean movesAvailable() { return grid.isCellsAvailable() || tileMatchesAvailable(); }