diff --git a/trees_and_tents.py b/trees_and_tents.py index 304d1c1..cbd7560 100644 --- a/trees_and_tents.py +++ b/trees_and_tents.py @@ -69,12 +69,12 @@ def get_possible_tents_in_row(row): return possible_tent_positions def get_neighbours(i, j): - cells = [] + cs = [] for p in range(max(i-1, 0), min(i+2, size_y)): for q in range(max(j-1, 0), min(j+2, size_x)): if p == i and q == j: continue - cells.append(cells[p][q]) - return cells + cs.append(cells[p][q]) + return cs def get_tree_neighbours(i, j): tree_pos = []