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

15 lines
301 B
Go
Raw Normal View History

2024-12-14 19:11:58 +00:00
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
}
}