chore(day17): implent A* path finder
All checks were successful
Go Bump / bump (push) Successful in 8s
Go Test / build (pull_request) Successful in 51s
Go Test / build (push) Successful in 35s

This commit was merged in pull request #19.
This commit is contained in:
xuu
2024-01-01 09:26:31 -07:00
parent 378e403c1c
commit 86f2f7a6f2
7 changed files with 261 additions and 145 deletions

View File

@@ -45,7 +45,7 @@ func run(scan *bufio.Scanner) (*result, error) {
}, nil
}
var OFFSET = map[string]aoc.Point{
var OFFSET = map[string]aoc.Point[int]{
"R": {0, 1},
"D": {1, 0},
"L": {0, -1},
@@ -77,7 +77,7 @@ func fromColor(c string) aoc.Vector {
}
func findArea(vecs []aoc.Vector) int {
shoelace := []aoc.Point{{0, 0}}
shoelace := []aoc.Point[int]{{0, 0}}
borderLength := 0
for _, vec := range vecs {