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

on attends la réponse

parent 3cb481cd
......@@ -56,7 +56,14 @@ print(popCaseXY([0,0]))
#### from now on, the functions deal with the graph with cells of 15*15 pixels ####
def denivele(graphe,p1,p2):
return(atan((graphe[p1[0]][p1[1]]-graphe[p2[0]][p2[1]])/15))
return(abs(atan((graphe[p1[0]][p1[1]]-graphe[p2[0]][p2[1]])/15))) #positif
def lambdad(graphe,p1,p2):
d=denivele(graphe,p1,p2)
res=0
if d<pi/9:
res=(pi/9-d)*9/pi
return(res)
def voisins(graphe,x,y):
'''graphe représente notre graphe sous la forme [[ ,[pop,alt], , ],...,[ , , , ]]'''
......@@ -67,7 +74,7 @@ def voisins(graphe,x,y):
flat=[]
for ligne in res:
for point in ligne:
if (point[0]>=0) & (point[0]<=largeur-1) & (point[1]>=0) & (point[1]<=longueur-1) & ([x,y]!=point) & (graphe[point[0]][point[1]]!=-1) & (graphe[point[0]][point[1]]<=50) & denivele(graphe,[x,y],point)<pi/9:
if (point[0]>=0) & (point[0]<=largeur-1) & (point[1]>=0) & (point[1]<=longueur-1) & ([x,y]!=point) & (graphe[point[0]][point[1]]!=-1) & (graphe[point[0]][point[1]]<=50):
flat.append(point)
return(flat)
......@@ -98,4 +105,15 @@ for i in range(4422,4436): #pixels de rize
for j in range(2103,2218):
if [i,j] not in pixelOutOfRize:
graphe[i//15][j//15][1]+=(-getPopXY(i,j))
graphe[i//15][j//15][2][0]+=getPopXY(i,j)
\ No newline at end of file
graphe[i//15][j//15][2][0]+=getPopXY(i,j)
def getZombiesOlder(listZombies):
for i in range(15):
listZombies[14-i]=listZombies[13-i]
listZombies[0]=0
def getGraphOlder(graphe):
for i in range(newWidth):
for j in range(newHeigth):
def stepOne(graphe):
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