Skip to content

About

A Z-machine interpreter: plays Infocom and Inform games (versions 3, 4, 5, 7 and 8)

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

@deckyard/zmachine

test Documentation release

A Z-machine interpreter: plays Infocom™ and Inform games, story files of versions 3, 4, 5, 7 and 8, with Quetzal saves and undo. The machine has no terminal of its own; the host sends it lines and shows what it prints, so a game runs as well in a chat bot or a web page as in a console. Pure Jennifer with no capabilities, so it runs on jennifer-tiny; only open reads a file.

Manual: https://deckyard.github.io/deck-zmachine/

Install

Requires Jennifer 0.27.0 or newer.

jvc add @deckyard/zmachine

jvc vendors the deck to vendor/deckyard/zmachine/. Without jvc, copy src/ from a checkout or a deckyard-zmachine-<version>.tar.gz release archive there, minus the test overlays:

mkdir -p vendor/deckyard/zmachine
cp -R path/to/deck-zmachine/src/. vendor/deckyard/zmachine/
find vendor/deckyard/zmachine -name '*_test.j' -delete

Example

use io;
import "@deckyard/zmachine/" as zmachine;

def m as zmachine.Machine init zmachine.run(zmachine.open("zork1.z3"));
$m = zmachine.send($m, "open mailbox");
io.printf("%s", zmachine.output($m));
# Opening the small mailbox reveals a leaflet.
#
# >
io.printf("%s\n", zmachine.upperWindow($m)[0]);
#  West of House                                               Score: 0  Moves: 1

examples/play.j plays a story in the console:

jennifer run examples/play.j zork1.z3

No game ships with the deck. Zork™ I-III are published by Microsoft™ under the MIT licence, the IF Archive holds hundreds of free Inform games, and testdata/lantern.z5 is a two-room test game.

Conformance

The test suite plays the Czech conformance suite in versions 3, 4, 5, 7 and 8 and Praxix in version 5, and every test in both passes. The manual's What is supported page lists what is left out.

Licence

LGPL-3.0-only, see LICENSE. Copyright (C) 2026 mplx <mplx@jennifer-lang.dev>. The test stories in testdata/ carry their own licences; see its README.

Trademarks

The MIT licence under which Microsoft published the Zork I-III source code covers the code only, not the game names. Zork™, Infocom™, Planetfall™, the other Infocom game titles and other product and company names may be trademarks of their respective owners. They are used only to identify the products this deck works with. This deck is an independent project, not affiliated with, sponsored or endorsed by Activision Publishing, Inc. or Microsoft Corporation.

About

A Z-machine interpreter: plays Infocom and Inform games (versions 3, 4, 5, 7 and 8)

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors