void BugAlgorithm(int x, int y) { Bug bug = new Bug(this); if (marked(x, y) == false && occupied(x, y-1) == false) { //if this tile is marked OR if the tile above is occupied: bug.start(x, y); } }