public boolean randomFlower()
{
Grid<Actor> gr = getGrid();
ArrayList<Location> loc = new ArrayList<Location>();
loc = gr.getOccupiedLocations();
int row = (int)(Math.random() * 19);
int col = (int)(Math.random() * 19);
Location new1 = new Location(row, col);
boolean existent = false;
// if i is less than size of occupied locations
for (int i = 0; i < loc.size(); i++);
// if i is equal to number of flowers
if(gr.get(loc.get(i)) instanceof Flower)
existent = true;
if(existent = false)
{
if(gr.get(new1) != null)
{
randomFlower();
}
else
{
Flower flower = new Flower();
flower.putSelfInGrid(gr, new1);
}
}
return true;
}
Title is self explanatory, Im getting an error cannot find symbol variable i