UNPKG

matrix-map

Version:

A class object for to aid in the creation of 2D grid games.

14 lines (11 loc) 273 B
const getEastEdge = function() { let rowSize = Math.sqrt(this.size) this.eastEdge = new Set(); for (let i = 0; i < this.size; i++) { let k = i+1 if(k%rowSize===0){ this.eastEdge.add(k); } } } export default getEastEdge