mirror of
https://github.com/onyx-and-iris/aoc2024.git
synced 2025-01-10 06:40:47 +00:00
15 lines
396 B
Go
15 lines
396 B
Go
package one
|
|
|
|
func neighbours(p point) [8]point {
|
|
return [8]point{
|
|
{y: p.y - 1, x: p.x, direction: N},
|
|
{y: p.y - 1, x: p.x + 1, direction: NE},
|
|
{y: p.y, x: p.x + 1, direction: E},
|
|
{y: p.y + 1, x: p.x + 1, direction: SE},
|
|
{y: p.y + 1, x: p.x, direction: S},
|
|
{y: p.y + 1, x: p.x - 1, direction: SW},
|
|
{y: p.y, x: p.x - 1, direction: W},
|
|
{y: p.y - 1, x: p.x - 1, direction: NW},
|
|
}
|
|
}
|