From: Neil Smith Date: Thu, 24 Dec 2020 16:49:09 +0000 (+0000) Subject: More loop cleaning X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=47e592658e720ad3f98bf023fe22b1350bf7d0d2;p=advent-of-code-20.git More loop cleaning --- diff --git a/advent15/src/advent15loop.hs b/advent15/src/advent15loop.hs index f023cf9..ca1d811 100644 --- a/advent15/src/advent15loop.hs +++ b/advent15/src/advent15loop.hs @@ -25,10 +25,10 @@ runGame seed roundsNeeded = gameLoop roundsNeeded round word history readSTRef word -gameLoop targetRound round word history = - do gameStep round word history - `untilM_` ((== targetRound) <$> readSTRef round) - return () +-- gameLoop targetRound round word history = +-- do gameStep round word history +-- `untilM_` ((== targetRound) <$> readSTRef round) +-- return () -- gameLoop targetRound round word history = -- do ( gameStep round word history @@ -55,10 +55,10 @@ gameLoop targetRound round word history = -- $ gameStep round word history -- return () --- gameLoop targetRound round word history = --- do whileM_ ((/= targetRound) <$> readSTRef round) --- $ gameStep round word history --- return () +gameLoop targetRound round word history = + do whileM_ ((/= targetRound) <$> readSTRef round) + $ gameStep round word history + return () seedGame seed historySize = do round <- newSTRef $ length seed