prepare a* algorithm

This commit is contained in:
Baipyrus 2024-01-27 23:49:41 +01:00
parent 00e53cdbd7
commit 5fa907c64e

View File

@ -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`);