mirror of
https://github.com/Baipyrus/AoC-23.git
synced 2024-11-14 09:43:49 +00:00
prepare a* algorithm
This commit is contained in:
parent
00e53cdbd7
commit
5fa907c64e
@ -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`);
|
||||
|
Loading…
Reference in New Issue
Block a user