From 4013cd6c7fea0d22c713e48c080925e8deb67b4d Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Thu, 26 Dec 2024 20:16:54 +0000 Subject: [PATCH] clean up function --- day-04/internal/one/neighbours.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/day-04/internal/one/neighbours.go b/day-04/internal/one/neighbours.go index 7b7d2c9..5063efc 100644 --- a/day-04/internal/one/neighbours.go +++ b/day-04/internal/one/neighbours.go @@ -2,13 +2,13 @@ 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}, + {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}, } }