Browse Source

added deepseq dependency, fixes

adaptedStrategy0
Slash 9 years ago
parent
commit
1d849d6fb1
2 changed files with 5 additions and 6 deletions
  1. +1
    -1
      icfp2015.cabal
  2. +4
    -5
      src/Main.hs

+ 1
- 1
icfp2015.cabal View File

@ -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


+ 4
- 5
src/Main.hs View File

@ -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"


Loading…
Cancel
Save