Naprawiono bug z DFS
This commit is contained in:
parent
9b22d4a166
commit
1963068dd6
@ -12,14 +12,15 @@ def DFS(grid, available_movement, gc_moveset, depth=0):
|
||||
possible_goals.append([a,b-1])
|
||||
house_in_area = False
|
||||
for location in possible_goals:
|
||||
try:
|
||||
cell = grid[location[0]][location[1]]
|
||||
if(type(cell) == House and cell.container.is_full and cell.unvisited):
|
||||
cell.unvisited = False
|
||||
house_in_area = True
|
||||
break
|
||||
except:
|
||||
continue
|
||||
if location[0]>=0 and location[1]>=0:
|
||||
try:
|
||||
cell = grid[location[0]][location[1]]
|
||||
if(type(cell) == House and cell.container.is_full and cell.unvisited):
|
||||
cell.unvisited = False
|
||||
house_in_area = True
|
||||
break
|
||||
except:
|
||||
continue
|
||||
if(house_in_area):
|
||||
xy = gc_moveset[-1]
|
||||
gc_moveset.append("pick_garbage")
|
||||
|
Loading…
Reference in New Issue
Block a user