From 25b83fa9b19c8372d55c61eb107a091093b60b9c Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Sun, 12 Jan 2025 11:09:22 +0000 Subject: [PATCH] Added links to blog posts --- advent24/Main.hs | 6 +++--- advent24/MainOriginal.hs | 1 + advent24/MainWithInvestigations.hs | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/advent24/Main.hs b/advent24/Main.hs index bf0bff3..11f04cd 100644 --- a/advent24/Main.hs +++ b/advent24/Main.hs @@ -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' diff --git a/advent24/MainOriginal.hs b/advent24/MainOriginal.hs index ab75a2e..ba3190a 100644 --- a/advent24/MainOriginal.hs +++ b/advent24/MainOriginal.hs @@ -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 diff --git a/advent24/MainWithInvestigations.hs b/advent24/MainWithInvestigations.hs index c91ec7e..cbe6197 100644 --- a/advent24/MainWithInvestigations.hs +++ b/advent24/MainWithInvestigations.hs @@ -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 -- 2.43.0