From a8e94c0bf63441bd5d015f68fcf7967c07cacd76 Mon Sep 17 00:00:00 2001 From: weiss Date: Mon, 13 Apr 2020 06:19:15 +0200 Subject: [PATCH] renamed loop to nextRound --- code_royal/src/Main.purs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/code_royal/src/Main.purs b/code_royal/src/Main.purs index 1a08ca8..fb0f8df 100644 --- a/code_royal/src/Main.purs +++ b/code_royal/src/Main.purs @@ -32,10 +32,10 @@ type GameState = main :: Effect Unit main = do initInput <- parseInitInput - loop initInput.numSites initInput.sites Nothing + nextRound initInput.numSites initInput.sites Nothing -loop :: Int -> Array SiteInfo -> Maybe GameState -> Effect Unit -loop numSites siteInfo gameState = do +nextRound :: Int -> Array SiteInfo -> Maybe GameState -> Effect Unit +nextRound numSites siteInfo gameState = do input <- parseInput numSites error $ show input @@ -53,11 +53,11 @@ loop numSites siteInfo gameState = do , leftSide: leftSide' } - let res = runState loop' gameState' + let res = runState loop gameState' let state = snd res let val = fst res log $ val - loop state.numSites (toSiteInfo <$> state.sites) (Just state) + nextRound state.numSites (toSiteInfo <$> state.sites) (Just state) where -- combine sites with siteInfo and old state @@ -87,8 +87,8 @@ loop numSites siteInfo gameState = do , lvl } -loop' :: State GameState String -loop' = do +loop :: State GameState String +loop = do ba <- buildAll ta <- trainAll pure $ ba <> "\n" <> ta