Skip to content

Haskell your own adventure! Parse, play and analyse gamebooks from text files.

License

Notifications You must be signed in to change notification settings

webbiscuit/haskell-adventure

Repository files navigation

Haskell Your Own Adventure

Build Status

What is it?

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.

Pre-reqs

Stack

stack setup
stack install hlint

Building

stack build

Debugging

stack ghci
parseTextIntoBook "1\nAll of these passages look alike. Turn to 1"

Running tests

stack test

To watch files and continuously run tests:

stack test --file-watch --fast

Linting

hlint src

Documentation

stack haddock --no-haddock-deps

Usage

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

Outputs

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

png, pdf, etc

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.

Sample Books

Fridge

A horror scenario where you wake up trapped inside a fridge.

About

Haskell your own adventure! Parse, play and analyse gamebooks from text files.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published