From: Neil Smith <neil.git@njae.me.uk>
Date: Sat, 4 Dec 2021 14:50:35 +0000 (+0000)
Subject: Added link to writeup
X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=a2c698f77bdabf3cf725a85743f1300ebf1796b1;p=advent-of-code-21.git

Added link to writeup
---

diff --git a/advent04/Main.hs b/advent04/Main.hs
index 0e11075..783d9f5 100644
--- a/advent04/Main.hs
+++ b/advent04/Main.hs
@@ -1,3 +1,5 @@
+-- Writeup at https://work.njae.me.uk/2021/12/04/advent-of-code-2021-day-4/
+
 import Data.Text ()
 import qualified Data.Text.IO as TIO
 
@@ -7,9 +9,12 @@ import Control.Applicative
 import Data.List
 
 type Square = [[Int]]
-type BingoSquare = [[BingoNum]]
+
 data BingoNum = BingoNum Int Bool
   deriving (Eq, Show)
+
+type BingoSquare = [[BingoNum]]
+
 data BingoState = BingoState Int [BingoSquare]
   deriving (Eq, Show)
 
@@ -52,7 +57,6 @@ pruningBingoStep (BingoState _ squares) caller = BingoState caller squares''
 hasCompletedSquare :: BingoState -> Bool
 hasCompletedSquare (BingoState _n squares) = any completed squares
 
-
 unmarkedSum :: BingoSquare -> Int
 unmarkedSum bingoSquare = 
   sum [value bn | r <- bingoSquare, bn <- r, (not $ isCalled bn)]