aoc2024/day-20/internal/one/neighbours.go

22 lines
335 B
Go
Raw Permalink Normal View History

2024-12-20 20:48:13 +00:00
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
}
}