Skip to content

Instantly share code, notes, and snippets.

@delevaa
Created November 11, 2012 16:24
Show Gist options
  • Save delevaa/4055414 to your computer and use it in GitHub Desktop.
Save delevaa/4055414 to your computer and use it in GitHub Desktop.
def sosedi2(e):
temp=[]
y=e[1]
x=e[0]
'''lev sosed'''
if y>0 & y<=len(table[0])-1 & x>=0 & x<=len(table)-1:
if matrica[x][y-1]==" ":
temp.append((x,y-1))
'''desen sosed'''
if len(table[0])-1>y & y>=0 & x>=0 & x<=len(table)-1:
if matrica[x][y+1]==" ":
temp.append((x,y+1))
'''dolen sosed'''
if len(table)-2>x & y>=0 & x>=0 &y<=len(table[0])-1:
if matrica[x+1][y]==" ":
temp.append((x+1,y))
return temp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment