X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=Ekitai.hs;h=9e416e1945f851947b0b6f08a582d10105e938f9;hb=73963404db8d4f3ff8b9b768678b87e981e4f745;hp=62e13417e56703dbe9d268d62866b57121756fb6;hpb=19625d0c9e1d31e1966815bfefba8af794b3dba2;p=ekitaihs.git diff --git a/Ekitai.hs b/Ekitai.hs index 62e1341..9e416e1 100644 --- a/Ekitai.hs +++ b/Ekitai.hs @@ -1,11 +1,38 @@ import System.Environment +import System.IO + +import qualified Data.Vector as V +import qualified Brick as B import Parse import Sim +import Render + +-- ui :: B.Widget () +-- ui = B.str "hello" <+> B.str "World" + +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 argv <- getArgs (opts, fname) <- ekitaiOpts argv - putStrLn fname + handle <- openFile fname ReadMode + contents <- hGetLines handle + hClose handle + -- putStrLn $ show $ stringToSim contents + initialState <- buildInitialState $ stringToSim contents + endState <- B.defaultMain ekitaiApp initialState + -- print endState return 0 +-- main :: IO () +-- main = do + -- return 0 +