Created
November 11, 2012 16:24
-
-
Save delevaa/4055414 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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