8000 GitHub - vollmerm/grue-hs: A Z-Machine interpreter for classic text adventure games implemented in Haskell · GitHub
[go: up one dir, main page]

Skip to content
vollmermPublic

About

A Z-Machine interpreter for classic text adventure games implemented in Haskell

Topics

Resources

Stars

8 stars

Watchers

0 watching

Forks

Repository files navigation

grue-hs

A Z-machine interpreter written in Haskell. The Z-machine is the virtual machine that ran Infocom's text adventures, such as Zork, A Mind Forever Voyaging, and Wishbringer. The interpreter fully supports versions 3 and 4 and has partial support for version 5.

Stories run in the terminal using ncurses.

Opening text of Wishbringer rendered in a terminal

Saving and restoring from files is supported via the Quetzal format.

Building

Requires GHC 9.10.x and cabal 3.12 or later.

cabal build
cabal install

Running

Once installed, grue-hs can be run from the terminal:

grue-hs story.z3

An optional random seed can be passed in with --seed N.

You can also run grue-hs from cabal directly (within this folder) like so:

cabal run grue-hs -- STORY.z3

The grue-hs executable opens a full-screen curses interface when run from a terminal. When its input or output is piped, or when run with --console, it falls back to plain stdio.

Testing

The cabal test suite runs a set of unit tests along with the (bundled) CZECH conformance suite at versions 3, 4, and 5, and a full save/restore roundtrip against the bundled cloak.z3:

cabal test

To run a single test or group, pass a tasty pattern:

cabal run grue-test -- -p Quetzal

Acknowledgements

While developing this project, I have relied on fizmo for high-quality code to study, as well as a reference interpreter for transcript comparison.

Additionally, "The Specification of the Z-Machine", by Graham Nelson has been invaluable when implementing the core Z-machine instructions.

License

BSD-3-Clause. See LICENSE.

About

A Z-Machine interpreter for classic text adventure games implemented in Haskell

Topics

Resources

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0