aoc2024/day-14/internal/two/neighbours.go
2024-12-14 19:15:21 +00:00

15 lines
301 B
Go

package two
func neighbours(p position) [8]position {
return [8]position{
{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
}
}