]> git.njae.me.uk Git - advent-of-code-24.git/commitdiff
Added links to blog posts
authorNeil Smith <NeilNjae@users.noreply.github.com>
Sun, 12 Jan 2025 11:09:22 +0000 (11:09 +0000)
committerNeil Smith <NeilNjae@users.noreply.github.com>
Sun, 12 Jan 2025 11:09:22 +0000 (11:09 +0000)
advent24/Main.hs
advent24/MainOriginal.hs
advent24/MainWithInvestigations.hs

index bf0bff3bfe6689dee9b3dbb839fcf77db8bfd3ba..11f04cda47f850a2d82938891e901859787124b9 100644 (file)
@@ -1,4 +1,5 @@
--- Writeup at https://work.njae.me.uk/2024/12/29/advent-of-code-2024-day-24/
+-- Writeup of the original manual version at https://work.njae.me.uk/2024/12/29/advent-of-code-2024-day-24/
+-- Writeup of this version at https://work.njae.me.uk/2025/01/10/advent-of-code-2024-day-24-revisited/
 
 import AoC
 
@@ -19,7 +20,7 @@ import Control.Monad (foldM)
 
 type Wires = M.Map String Int
 
-data GateType = And | Or | Xor | Carry | Output
+data GateType = And | Or | Xor | Carry 
   deriving (Show, Eq, Ord)
 
 data Gate = Gate { gType :: GateType, inputs :: [String], output :: String }
@@ -70,7 +71,6 @@ simulateGate wires gate = M.insert gate.output result wires
           Or  -> (wires M.! i1) .|. (wires M.! i2)
           Xor -> (wires M.! i1) `xor` (wires M.! i2)
           Carry -> error "Carry not implemented"
-          Output -> error "Output not implemented"
 
 isOutputWire :: String -> Bool
 isOutputWire (x:_) = x == 'z'
index ab75a2ed61731a74cfabaeeed2dda3d20e95880f..ba3190a05f54229c2ecf1e5d25fb079d9b72aeed 100644 (file)
@@ -1,4 +1,5 @@
 -- Writeup at https://work.njae.me.uk/2024/12/29/advent-of-code-2024-day-24/
+-- See a writeup of an automated solution at https://work.njae.me.uk/2025/01/10/advent-of-code-2024-day-24-revisited/
 
 import AoC
 
index c91ec7eb6657d53971b1f466b1fb453da30a145d..cbe61976c63fbc7022c62d0697cd5aa09732b720 100644 (file)
@@ -1,4 +1,5 @@
--- Writeup at https://work.njae.me.uk/2024/12/29/advent-of-code-2024-day-24/
+-- Writeup of the original manual version at https://work.njae.me.uk/2024/12/29/advent-of-code-2024-day-24/
+-- Writeup of this version at https://work.njae.me.uk/2025/01/10/advent-of-code-2024-day-24-revisited/
 
 import AoC