X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=Ekitai.hs;h=6d0c8675a692593c6bf97a10b08e0399dc881ed4;hb=4de2980e358a4ed8bb05e615a3fee16215b03c1f;hp=e413b67de13c4f5c6ed8412d59d0504178486a6b;hpb=5b8e53984e97f64f62f5c5f607322006dbddfabc;p=ekitaihs.git diff --git a/Ekitai.hs b/Ekitai.hs index e413b67..6d0c867 100644 --- a/Ekitai.hs +++ b/Ekitai.hs @@ -1,10 +1,29 @@ import System.Environment +import System.IO + +import qualified Data.Vector as V import Parse +import Sim +import Render + +hGetLines :: Handle -> IO [String] +hGetLines h = do + line <- hGetLine h + isEof <- hIsEOF h + if isEof then return [line] + else do + lines <- hGetLines h + return (line:lines) main = do + -- handle file stuff argv <- getArgs (opts, fname) <- ekitaiOpts argv - putStrLn fname + handle <- openFile fname ReadMode + contents <- hGetLines handle + hClose handle + -- start brick + ekitaiMain (stringToSim contents) (optTimeStep opts) return 0