diff --git a/icfp2015.cabal b/icfp2015.cabal index 7c61263..175bb83 100644 --- a/icfp2015.cabal +++ b/icfp2015.cabal @@ -60,7 +60,7 @@ executable icfp2015 other-extensions: OverloadedStrings, DeriveGeneric, DeriveDataTypeable -- Other library packages from which modules are imported. - build-depends: base >=4.6 && <4.9, hashable >=1.2 && <1.3, containers >=0.5 && <0.6, QuickCheck >=2.7 && <2.9, bytestring >=0.10 && <0.11, aeson >=0.8 && <0.9, pqueue >=1.3 && <1.4, clock, random + build-depends: base >=4.6 && <4.9, hashable >=1.2 && <1.3, containers >=0.5 && <0.6, QuickCheck >=2.7 && <2.9, bytestring >=0.10 && <0.11, aeson >=0.8 && <0.9, pqueue >=1.3 && <1.4, clock, random, deepseq >= 1.3 && <1.4 -- Directories containing source files. hs-source-dirs: src diff --git a/src/Main.hs b/src/Main.hs index c8a0de2..10e2d3d 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -80,13 +80,12 @@ main = do args <- getArgs let (ids,seeds,gamecomputations) = unzip3 loaddata inittime <- secTime results <- iterategc gamecomputations (timestruct timelimit inittime) memlimit - putStrLn "lol" let (commandswpoints,strat) = unzip results let (commandlists, points) = unzip commandswpoints let wordlists = map cmdToString commandlists let outJSONstructs = zipWith3 (\x y z -> (JSONSer x y strategyTag z)) ids seeds wordlists BS.putStrLn $ encode outJSONstructs - writelogfile logf (zip4 ids seeds points strat) + writeLogFile logf (zip4 ids seeds points strat) where timestruct Nothing _ = Nothing timestruct (Just maxtime) intime = Just (maxtime, intime) @@ -143,9 +142,9 @@ secTime :: IO Int64 secTime = do (TimeSpec s _) <- getTime Monotonic return s -writelogfile :: Bool -> [(Int,Int,Int,Int)] -> IO () -writelogfile False _ = return () -writelogfile _ els = writeFile logFileName scoredata +writeLogFile :: Bool -> [(Int,Int,Int,Int)] -> IO () +writeLogFile False _ = return () +writeLogFile _ els = writeFile logFileName scoredata where scoredata = foldl strlog "\n" els strlog x (a,b,c,d) = sa ++ sb ++ sc ++ sd ++ x ++ "\n"