A functional project that can parse, play and analyse gamebooks from text.
This early version parses basic text files into section and choice objects and can output in a few different ways.
Stack
stack setup
stack install hlint
stack build
stack ghci
parseTextIntoBook "1\nAll of these passages look alike. Turn to 1"
stack test
To watch files and continuously run tests:
stack test --file-watch --fast
hlint src
stack haddock --no-haddock-deps
stack run -- --file app/books/fridge.txt
or
stack run -- --stdin < app/books/fridge.txt
or (when built)
haskelladventure.exe --stdin < path-to-your-gamebook
There are a few formats currently supported:
debug (haskell debugging)
json (parsed as json objects)
dot (graphviz dot format)
stack run -- --output json --file app/books/fridge.txt
Right now the simplest way is to install Graphviz, export to dot format and use the many outputs via the dot cli. Example:
stack run -- --output dot --file app/books/fridge.txt | dot -T png > out.png
Where T (type) can be any of these formats.
A horror scenario where you wake up trapped inside a fridge.