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