Solve 2024-18 (using A* lib)

This commit is contained in:
2024-12-19 15:20:16 +01:00
parent a2f386277f
commit 7bd85e5f6b
6 changed files with 226 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
import { describe, expect, it } from 'bun:test';
import { solveFirst, solveSecond } from './index.ts';
describe('2024-18', () => {
const testInput = `5,4
4,2
4,5
3,0
2,1
6,3
2,4
1,5
0,6
3,3
2,6
5,1
1,2
5,5
2,5
6,5
1,4
0,4
6,4
1,1
6,1
1,0
0,5
1,6
2,0`;
it('first', () => {
expect(solveFirst(testInput, 7, 7, 12)).toBe(22);
});
it('second', () => {
expect(solveSecond(testInput, 7, 7, 12)).toBe('6,1');
});
});