From 181b3d6a36a6cb74e355727c71b60f0898191468 Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Sun, 2 May 2021 14:54:06 -0400 Subject: [PATCH] docs --- Parse.hs | 16 +++------------- ekitai.1 | 17 ++++++++++++++++- readme.md | 17 +++++++++++++++-- samples/letter | 38 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 72 insertions(+), 16 deletions(-) create mode 100644 samples/letter diff --git a/Parse.hs b/Parse.hs index 9b9de57..2375c4f 100644 --- a/Parse.hs +++ b/Parse.hs @@ -8,26 +8,16 @@ import Data.Maybe import Data.Either data Options = Options - { optHelp :: Bool - , optColor :: Bool - , optTimeStep :: Int + { optTimeStep :: Int } defaultOptions = Options - { optHelp = False - , optColor = False - , optTimeStep = 50000 + { optTimeStep = 50000 } options :: [OptDescr (Options -> Options)] options = - [ Option ['h'] ["help"] - (NoArg (\opts -> opts { optHelp = True })) - "display's this message" - , Option ['c'] ["color", "colour"] - (NoArg (\opts -> opts { optColor = True })) - "enables color" - , Option ['t'] ["timestep"] + [ Option ['t'] ["timestep"] (ReqArg (\t opts -> opts { optTimeStep = read t :: Int }) "timestep") "sets the simulation time step" ] diff --git a/ekitai.1 b/ekitai.1 index 0210793..a9f79aa 100644 --- a/ekitai.1 +++ b/ekitai.1 @@ -1,10 +1,25 @@ -.TH EKITAI 1 2021-04-30 +.TH EKITAI 1 2021-05-02 .SH NAME ekitai \- terminal fluid simulation written in haskell .SH SYNOPSIS .B ekitai +[ekitai options] filename .SH DESCRIPTION +ekitai.hs is a terminal fluid simulator written in haskell. it is a submission to RUHacks 2021. the simulation algorithm is quite simple, it's a similar particle based one that games like 'the sandbox' and 'terraria' use. .SH OPTIONS +.TP +\fB\-t\fR <\fITIMESTEP\fP>, \fB\-\-timestep=\fR\fITIMESTEP\fR +Changes the physics timestep, default is 50000. +.SH FILES +ekitai reads in a file with special characters that represents simulation elements. here is a list of valid characters: + +#: wall block, stationary and blocks movement + +~: water block + +@: pump block, spawns water below it + +O: drain block, removes water around it .SH AUTHORS \fBekitai\fP was written by Daniel Liu .SH REPORTING BUGS diff --git a/readme.md b/readme.md index 87d051c..588af9d 100644 --- a/readme.md +++ b/readme.md @@ -1,12 +1,25 @@ # 液体「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. the simulation algorithm is quite simple, it's a similar particle based one that games like 'the sandbox' and 'terraria' use. + +## Usage +ekitai reads a text file with the desired simulation. samples can be found in the samples/ directory of this repo. valid characters for the simulation are as follows +- `#`: wall block +- `~`: water +- `@`: pump, spawns water below it +- `O`: drain, removes water around it ## Installation ### Deb based ### Arch based ### Build from Source -this will be incredibly painful +as this project does not use stack or cabal or anything, haskell dependencies will have to be installed separately. if you are on arch, make sure you have the following (find equivalent depending on distro): +- ghc +- ghc-static +- ghc-libs +- haskell-brick + +and then simply run `make install`. ## FAQ **why ekitai?** diff --git a/samples/letter b/samples/letter new file mode 100644 index 0000000..895bb45 --- /dev/null +++ b/samples/letter @@ -0,0 +1,38 @@ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + + ####### ## ## ######## ######## ##### ######## ## ## ####### + ### ## #### #### ######## ### ### #### ## ## ### ## + ####### ##### ## ## ####### ## ####### ##### + ####### ##### ## ## ####### ## ####### ##### + ### ## #### #### ## ## ## #### ## ## ## ## ## + ####### ## ## ######## ## ## ## ######## ## ## ## ####### + + ####### ## ## ######## ######## ##### ######## ## ## ####### + ### ## #### #### ######## ### ### #### ## ## ### ## + ####### ##### ## ## ####### ## ####### ##### + ####### ##### ## ## ####### ## ####### ##### + ### ## #### #### ## ## ## #### ## ## ## ## ## + ####### ## ## ######## ## ## ## ######## ## ## ## ####### + + ####### ## ## ######## ######## ##### ######## ## ## ####### + ### ## #### #### ######## ### ### #### ## ## ### ## + ####### ##### ## ## ####### ## ####### ##### + ####### ##### ## ## ####### ## ####### ##### + ### ## #### #### ## ## ## #### ## ## ## ## ## + ####### ## ## ######## ## ## ## ######## ## ## ## ####### + + ####### ## ## ######## ######## ##### ######## ## ## ####### + ### ## #### #### ######## ### ### #### ## ## ### ## + ####### ##### ## ## ####### ## ####### ##### + ####### ##### ## ## ####### ## ####### ##### + ### ## #### #### ## ## ## #### ## ## ## ## ## + ####### ## ## ######## ## ## ## ######## ## ## ## ####### + + + + + -- 2.20.1