This commit is contained in:
nim-ka
2021-12-29 03:15:45 -05:00
commit a37eee947f
9 changed files with 1529 additions and 0 deletions

7
utils.js Normal file
View File

@@ -0,0 +1,7 @@
utils = {
fetch: (url) => fetch(url).then(e => e.text()),
fetchEval: (url) => utils.fetch(url).then(e => eval(e)),
signAgnosticInclusiveRange: (a, b, s = Math.sign(a - b)) => Array((a - b) * s + 1).fill().map((_, i) => a - i * s),
createGridArray: (w, h, fill = undefined) => Array(h).fill().map(() => Array(w).fill(fill))
}