dist/Board.js
function getAllNearPositions(position) {
    return [[-1, -1], [0, -1], [1, -1], [-1, 0], [1, 0], [-1, 1], [0, 1], [1, 1] // Below positions
    ].map(function (toAdd) {
        return {
            x: position.x + toAdd[0],
            y: position.y + toAdd[1]
        };
    });
}
function getAllNearPositions(position) {
    return [[-1, -1], [0, -1], [1, -1], [-1, 0], [1, 0], [-1, 1], [0, 1], [1, 1] // Below positions
    ].map(function (toAdd) {
        return {
            x: position.x + toAdd[0],
            y: position.y + toAdd[1]
        };
    });
}
function getAllNearPositions ( position ) { return [ [ - 1 , - 1 ] , [ 0 , - 1 ] , [ 1 , - 1 ] , [ - 1 , 0 ] , [ 1 , 0 ] , [ - 1 , 1 ] , [ 0 , 1 ] , [ 1 , 1 ] // Below positions ] . map ( function ( toAdd ) { return { x : position . x + toAdd [ 0 ] , y : position . y + toAdd [ 1 ] } ; } ) ; }
Get all valid and invalid near positions.
Get all valid and invalid near positions .