mirror of
https://github.com/onyx-and-iris/aoc2024.git
synced 2025-01-10 14:50:46 +00:00
18 lines
194 B
Go
18 lines
194 B
Go
package two
|
|
|
|
const (
|
|
N = iota
|
|
E
|
|
S
|
|
W
|
|
)
|
|
|
|
func neighbours(p point) [4]point {
|
|
return [4]point{
|
|
{p.x, p.y - 1}, // N
|
|
{p.x + 1, p.y}, // E
|
|
{p.x, p.y + 1}, // S
|
|
{p.x - 1, p.y}, // W
|
|
}
|
|
}
|