Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Golf solution in Creative category for Moore Neighbourhood by altarfinch
# migrated from python 2.7
count_neighbours=lambda m,I,J,w=list(range(-1,2)):sum(m[I+i][J+j]for i in w for j in w if(i,j)!=(0,0)>len(m)>I+i>~0
Feb. 9, 2015
Comments: