aoc2024/day-18/internal/two/neighbours.go
onyx-and-iris 22b442171b add point subpackage
build ShortestPath as ordered map

replace dijkstra in part two with a bfs
2024-12-19 21:32:21 +00:00

13 lines
271 B
Go

package two
import "github.com/onyx-and-iris/aoc2024/day-18/internal/point"
func neighbours(p point.Point) [4]point.Point {
return [4]point.Point{
{X: p.X, Y: p.Y - 1}, // N
{X: p.X + 1, Y: p.Y}, // E
{X: p.X, Y: p.Y + 1}, // S
{X: p.X - 1, Y: p.Y}, // W
}
}