import System.Environment
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"
+
+-- main :: IO ()
main = do
- argv <- getArgs
- (opts, fname) <- ekitaiOpts argv
- putStrLn fname
- return 0
+ initialState <- buildInitialState
+ endState <- B.defaultMain ekitaiApp initialState
+ print endState
+ -- argv <- getArgs
+ -- (opts, fname) <- ekitaiOpts argv
+ -- return 0
--- /dev/null
+module Render ( buildInitialState, ekitaiApp ) where
+
+import Brick.AttrMap
+import Brick.Main
+import Brick.Types
+import Brick.Widgets.Core
+import Graphics.Vty.Input.Events
+
+type ResourceName = String
+
+data EkitaiState =
+ EkitaiState deriving (Show)
+
+ekitaiApp :: App EkitaiState e ResourceName
+ekitaiApp = App
+ { appDraw = drawEkitai
+ , appChooseCursor = showFirstCursor
+ , appHandleEvent = handleEkitaiEvent
+ , appStartEvent = pure
+ , appAttrMap = const $ attrMap mempty []
+ }
+
+buildInitialState :: IO EkitaiState
+buildInitialState = pure EkitaiState
+
+drawEkitai :: EkitaiState -> [Widget ResourceName]
+drawEkitai state = []
+
+handleEkitaiEvent :: EkitaiState -> BrickEvent n e -> EventM n (Next EkitaiState)
+handleEkitaiEvent s e =
+ case e of
+ VtyEvent vtye ->
+ case vtye of
+ EvKey (KChar 'q') [] -> halt s
+ _ -> continue s
+ _ -> continue s
+
--- /dev/null
+.TH EKITAI 1 2021-04-30
+.SH NAME
+ekitai \- terminal fluid simulation written in haskell
+.SH SYNOPSIS
+.B ekitai
+.SH DESCRIPTION
+.SH OPTIONS
+.SH AUTHORS
+\fBekitai\fP was written by Daniel Liu
+.SH REPORTING BUGS
+Please open an issue at https://github.com/MrPicklePinosaur/ekitai.hs
--- /dev/null
+
+HC=ghc
+DHC=ghci
+HFLAGS=-dynamic -threaded
+
+.PHONY: ekitai clean test
+
+ekitai: Ekitai.hs
+ $(HC) $(HFLAGS) --make $<
+
+test: Ekitai.hs
+ $(DHC) $<
+
+clean:
+ rm Ekitai *.o *.hi
# 液体「ekitai」
-ekitai.hs is a terminal fluid simulator written in haskell. It is a submission to RUHacks 2021.
+ekitai.hs is a terminal fluid simulator written in haskell. it is a submission to RUHacks 2021.
+
+## Installation
+### Deb based
+### Arch based
+### Build from Source
+this will be incredibly painful
+
+## FAQ
+**why ekitai?**
+ekitai is fluid in japanese. since naming your projects in a different language is apparently cool.
+
+**why not in c?**
+c would have probably been one of the best choices to do this project in, but i wanted to add a bit of challenge by using a language that i didn't know.