Commit 7aaa0235 authored by Grégoire PETIT's avatar Grégoire PETIT
Browse files

height -> size (clearer)

parent 01a0fc5e
......@@ -85,8 +85,8 @@ def voisins(graphe,x,y):
flat.append(point)
return(flat)
def neighbors(node, height):
#height represent the whole size of the image
def neighbors(node, size):
#size represent the whole size of the image
my_neighbors =[]
x,y = node[0],node[1]
......@@ -96,15 +96,15 @@ def neighbors(node, height):
my_neighbors.append((x,y-1))
if x-1>=0 and y-1>=0:
my_neighbors.append((x-1,y-1))
if x+1<height[0]:
if x+1<size[0]:
my_neighbors.append((x+1,y))
if y+1<height[1]:
if y+1<size[1]:
my_neighbors.append((x,y+1))
if x+1<height[0] and y+1<height[1]:
if x+1<size[0] and y+1<size[1]:
my_neighbors.append((x+1,y+1))
if x+1<height[0] and y-1>=0:
if x+1<size[0] and y-1>=0:
my_neighbors.append((x+1,y-1))
if y+1<height[1] and x-1>=0:
if y+1<size[1] and x-1>=0:
my_neighbors.append((x-1,y+1))
return my_neighbors
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment