From 35243b8b5029df81f6337f316f7999ec1e450fe5 Mon Sep 17 00:00:00 2001 From: Sander Date: Mon, 1 Dec 2025 22:19:39 +0000 Subject: [PATCH] Update sander/AoC 2025 --- sander/AoC 2025 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sander/AoC 2025 b/sander/AoC 2025 index a92028c..f2c3c5d 100644 --- a/sander/AoC 2025 +++ b/sander/AoC 2025 @@ -20,7 +20,7 @@ main = do handle <- openFile "C:/Users/[your directory here]/d1.txt" ReadMode -- Day 1: ... --- Part One (not correct yet) +-- Part One (correct) doday1_1 :: String -> String doday1_1 input = show (countZeroRotations (words input) 50) @@ -39,10 +39,11 @@ rotateDial (direction : r) pos newposr = normalizeHundred (pos + (read r)) normalizeHundred :: Int -> Int -normalizeHundred x - | x >= 100 = x - 100 - | x < 0 = x + 100 - | True = x +normalizeHundred x + | x >= 0 && x < 100 = x + | x >= 100 = normalizeHundred (x - 100) + | x < 0 = normalizeHundred (x + 100) + | True = x -- Part Two