From fb46fceb75e06adf7aa7712a125e94843444ae18 Mon Sep 17 00:00:00 2001 From: Kharec Date: Mon, 1 Dec 2025 22:48:56 +0100 Subject: [PATCH] refactor: just moving code here and there --- internal/2015/DaySix/code.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/2015/DaySix/code.go b/internal/2015/DaySix/code.go index d438f0b..ef3faa9 100644 --- a/internal/2015/DaySix/code.go +++ b/internal/2015/DaySix/code.go @@ -7,21 +7,16 @@ import ( "strings" ) -func init() { - registry.Register("2015D6", ParseInput, PartOne, PartTwo) -} - -func ParseInput(filepath string) []string { - content, _ := os.ReadFile(filepath) - return strings.Split(strings.TrimSpace(string(content)), "\n") -} - type instruction struct { operation string x1, y1 int x2, y2 int } +func init() { + registry.Register("2015D6", ParseInput, PartOne, PartTwo) +} + func parseInstruction(line string) (instruction, bool) { var op string var remaining string @@ -52,6 +47,11 @@ func parseInstruction(line string) (instruction, bool) { return instruction{operation: op, x1: x1, y1: y1, x2: x2, y2: y2}, true } +func ParseInput(filepath string) []string { + content, _ := os.ReadFile(filepath) + return strings.Split(strings.TrimSpace(string(content)), "\n") +} + func PartOne(data []string) int { grid := make([]bool, 1000*1000)