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

15 lines
260 B
Go
Raw Normal View History

2024-12-05 01:31:44 +00:00
package one
func neighbours(p point) [8]point {
return [8]point{
2024-12-26 20:16:54 +00:00
{p.x, p.y - 1, N},
{p.x + 1, p.y - 1, NE},
{p.x + 1, p.y, E},
{p.x + 1, p.y + 1, SE},
{p.x, p.y + 1, S},
{p.x - 1, p.y + 1, SW},
{p.x - 1, p.y, W},
{p.x - 1, p.y - 1, NW},
2024-12-05 01:31:44 +00:00
}
}