Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First we take Manhattan... solution in Creative category for Moore Neighbourhood by veky
count_neighbours = lambda grid, I, J: sum(cell
for i, row in enumerate(grid)
for j, cell in enumerate(row)
if max(abs(i-I), abs(j-J)) == 1)
Oct. 1, 2014
Comments: