From 958bbf25b736c26869028ab2b1d035f4d22ca921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20P=C3=A4tzel?= Date: Fri, 18 Oct 2019 13:37:16 +0200 Subject: [PATCH] Add primitive iteration count CLI argument --- src/Main.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Main.hs b/src/Main.hs index 280c8d6..1639f01 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -12,9 +12,11 @@ mkPop = population 100 (I prios []) main :: IO () main = do + args <- getArgs + let t = fromMaybe 100 $ headMay args >>= readMaybe hSetBuffering stdout NoBuffering pop <- mkPop - pop' <- runEffect $ for (run 2 1 pop (steps 100)) log + pop' <- runEffect $ for (run 2 1 pop (steps t)) log res <- bests 5 pop' sequence_ $ format <$> res where