Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
one liner list comprehension solution in Uncategorized category for Moore Neighbourhood by Pouf
count_neighbours = lambda g,r,c:sum(g[x][y]for x in range(max(r-1,0),min(r+2,len(g)))for y in range(max(c-1,0),min(c+2,len(g[0]))))-g[r][c]
Oct. 24, 2014