All pastes #2074500 Raw Edit

Untitled

public java v1 · immutable
#2074500 ·published 2011-06-04 08:25 UTC
rendered paste body
int grass_Count = 0;			float grass_Percent = 0;			while (grass_Percent < 30){				for (int i = 1; i < world_Map.map_cells.length - 1; i++){				for (int j = 1; j < world_Map.map_cells[i].length - 1; j++){									int NORTH = i - 1;					int SOUTH = i + 1;					int EAST = j + 1;					int WEST = j - 1;										if ((!world_Map.map_cells[i][j].isVisited()) & (world_Map.map_cells[i][j].get_terrain()==3)){						world_Map.map_cells[i][j].setVisited(true);						//check surrounding cells...						for (int ii = NORTH; ii < SOUTH; ii++){							for (int jj= WEST; jj < EAST; jj++){									world_Map.map_cells[ii][jj].set_terrain(3);									grass_Count +=1;									grass_Percent=((grass_Count/ world_Map.get_size())/100);									System.out.println("Grass_Count: " + grass_Count + " Grass_Percent: " + grass_Percent + " Size: "+ world_Map.get_size());								}							}						}					}				}			}			print("Grass Percentages calculated");