aoc2024/day-18/internal/two/neighbours.go

13 lines
271 B
Go
Raw Permalink Normal View History

2024-12-18 18:48:11 +00:00
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
2024-12-18 18:48:11 +00:00
}
}