Someone
public java v1 · immutableint[4] x = {worldMap.mapCells[i - 1][j].getTerrain(),worldMap.mapCells[i][j + 1].getTerrain(),worldMap.mapCells[i + 1][j].getTerrain(),worldMap.mapCells[i][j - 1].getTerrain()}for (int counter = 0; i < x.length; i++){if (worldMap.mapCells[i][j].getTerrain() == x.getTerrain()){break;}else worldMap.mapCells[i][j].setTerrain();}