mirror of
https://github.com/Baipyrus/AoC-23.git
synced 2024-12-27 12:31:45 +00:00
parse tiles into grid
This commit is contained in:
parent
c1453d6634
commit
00e53cdbd7
@ -2,8 +2,19 @@ import { readFileSync } from "fs";
|
|||||||
const t0 = performance.now();
|
const t0 = performance.now();
|
||||||
|
|
||||||
const input = readFileSync("input.txt")
|
const input = readFileSync("input.txt")
|
||||||
.toString();
|
.toString()
|
||||||
console.log(input);
|
.split(/\r*\n/)
|
||||||
|
.filter((e) => e.length > 0)
|
||||||
|
.map((a, j) => a
|
||||||
|
.split("")
|
||||||
|
.map((b, i) => ({
|
||||||
|
c: +b,
|
||||||
|
x: i,
|
||||||
|
y: j,
|
||||||
|
d: 0,
|
||||||
|
h: 0
|
||||||
|
})));
|
||||||
|
console.log(input[0].slice(-1)[0]);
|
||||||
|
|
||||||
const t1 = performance.now();
|
const t1 = performance.now();
|
||||||
console.log(`Runtime: ${t1 - t0}ms`);
|
console.log(`Runtime: ${t1 - t0}ms`);
|
||||||
|
Loading…
Reference in New Issue
Block a user