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

15 lines
290 B
Go
Raw Normal View History

2024-12-18 14:45:27 +00:00
package two
func neighbours(p point) []point {
return []point{
{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
}
}