chore(day17): implent A* path finder
This commit was merged in pull request #19.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user