This commit is contained in:
nim-ka
2022-10-29 02:53:58 +00:00
parent 790ec30845
commit bc0bbdccd2

View File

@@ -26,7 +26,7 @@ class Grid {
return this.mapMut((_, pt) => arr[pt.y][pt.x])
}
fillFromStr(str, sep = "") { return this.fillFromArr(str.split("\n").map((line) => line.split(sep)) }
fillFromStr(str, sep = "") { return this.fillFromArr(str.split("\n").map((line) => line.split(sep))) }
static fromArr(arr) { return new Grid(arr[0].length, arr.length).fillFromArr(arr) }
static fromStr(str, sep = "") { return Grid.fromArr(str.split("\n").map((line) => line.split(sep)) }