Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Moore Neighbourhood by skyJuice
def count_neighbours(grid, row, col):
moor = [(-1,-1),(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1), (0,-1)]
count = 0
for i in moor:
if(0<=row+i[0]
Sept. 30, 2014
Comments: