Update sander/AoC 2025

sander
Sander 2025-12-01 22:19:39 +00:00
parent a2fe8b86ee
commit 35243b8b50
1 changed files with 6 additions and 5 deletions

View File

@ -20,7 +20,7 @@ main = do handle <- openFile "C:/Users/[your directory here]/d1.txt" ReadMode
-- Day 1: ... -- Day 1: ...
-- Part One (not correct yet) -- Part One (correct)
doday1_1 :: String -> String doday1_1 :: String -> String
doday1_1 input = show (countZeroRotations (words input) 50) doday1_1 input = show (countZeroRotations (words input) 50)
@ -40,8 +40,9 @@ rotateDial (direction : r) pos
normalizeHundred :: Int -> Int normalizeHundred :: Int -> Int
normalizeHundred x normalizeHundred x
| x >= 100 = x - 100 | x >= 0 && x < 100 = x
| x < 0 = x + 100 | x >= 100 = normalizeHundred (x - 100)
| x < 0 = normalizeHundred (x + 100)
| True = x | True = x
-- Part Two -- Part Two