This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function initialiseGrid(w, h) { | |
// first get all the initial max radii | |
let temp = [] | |
for (let x = 0; x < w; x++) { | |
for (let y = 0; y < h; y++) { | |
let k = JSON.stringify([x, y]) | |
temp.push([k, Math.min(x, y, w-x, h-y)]) | |
} | |
} | |
// now shuffle, so that we do not need to filter |
OlderNewer