Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
shifts solution in Clear category for [old] Moore Neighbourhood by woe_from_wit
"use strict";
var SHIFTS = [
[-1, 0],
[-1, 1],
[-1, -1],
[0, 1],
[0, -1],
[1, 0],
[1, 1],
[1, -1]
]
function countNeighbours(data, row, col) {
return SHIFTS.filter((el) => {
try{
return data[row + el[0]][col + el[1]];
} catch (e) {}
}).length
}
Oct. 17, 2016
Comments: