Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getNeighbors(x,y):
- def app(arr , x,y):
- arr.append([dice[y][x] , resources[y][x]])
- pairs = []
- if(x > 0 and y < 4):
- #upperleft
- app(pairs ,x-1, y )
- if(x < 4 and y < 4):
- #upperright
- app(pairs ,x, y )
- if(x > 0 and y > 0):
- #lowerleft
- app(pairs ,x-1, y-1 )
- if(x < 4 and y > 0):
- #lowerright
- app(pairs ,x, y-1 )
- return pairs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement