Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Moore Neighbourhood by ikami
def count_neighbours(grid, row, col):
how_many=0
for i in range(row-1,row+2):
for j in range(col-1,col+2):
if i>=0 and j>=0 and (i!=row or j!=col) and i
Oct. 15, 2015