mirror of
https://github.com/onyx-and-iris/aoc2024.git
synced 2025-01-10 14:50:46 +00:00
15 lines
260 B
Go
15 lines
260 B
Go
package one
|
|
|
|
func neighbours(p point) [8]point {
|
|
return [8]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},
|
|
}
|
|
}
|