diff --git a/Day17/Part1.js b/Day17/Part1.js index 3f2221a..37913e7 100644 --- a/Day17/Part1.js +++ b/Day17/Part1.js @@ -11,10 +11,16 @@ const input = readFileSync("input.txt") c: +b, x: i, y: j, - d: 0, - h: 0 + g: 0, + h: 0, }))); -console.log(input[0].slice(-1)[0]); +const man_dist = (a, b) => Math.abs(b.x - a.x) + Math.abs(b.y - a.y); + +const start = input[0][0]; +const end = input.slice(-1)[0].slice(-1)[0]; +const open = [start], closed = []; + +console.log(end.g); const t1 = performance.now(); console.log(`Runtime: ${t1 - t0}ms`);