mirror of
https://github.com/onyx-and-iris/aoc2024.git
synced 2025-01-09 22:30:47 +00:00
22 lines
335 B
Go
22 lines
335 B
Go
package one
|
|
|
|
import "github.com/onyx-and-iris/aoc2024/day-20/internal/point"
|
|
|
|
type direction int
|
|
|
|
const (
|
|
N direction = iota
|
|
E
|
|
S
|
|
W
|
|
)
|
|
|
|
func neighbours(p point.Point) [4]point.Point {
|
|
return [4]point.Point{
|
|
point.New(p.X, p.Y-1), // N
|
|
point.New(p.X+1, p.Y), // E
|
|
point.New(p.X, p.Y+1), // S
|
|
point.New(p.X-1, p.Y), // W
|
|
}
|
|
}
|