- Nix 61.5%
- Zig 38.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JgneSjfhLtbUbGGZEYCpxs |
||
| .tangled/workflows | ||
| LICENSES | ||
| .gitignore | ||
| build.zig | ||
| build.zig.zon | ||
| build.zig.zon.nix | ||
| flake.lock | ||
| flake.nix | ||
| README.md | ||
| REUSE.toml | ||
| typos.toml | ||
zig-zork
Zork (a.k.a. Dungeon), built with the Zig build system.
This project packages devshane/zork — the
C port of the original 1977–1981 MIT mainframe Zork — using zig build in
place of the original Makefile. The game source is pulled in as a Zig package
dependency; no code is vendored here.
Requirements
- Zig 0.16
- termcap (headers and library)
- A C compiler is not needed separately — Zig compiles the C sources.
Building
zig build
The results land in zig-out/:
zig-out/bin/zig-zork— the gamezig-out/share/zork/dtextc.dat— the game data file (its absolute install path is baked into the binary at compile time, so use--prefixif you want to install somewhere permanent)zig-out/share/man/man6/dungeon.6— the manpage
To build and play in one step:
zig build run
Build options
| Option | Default | Description |
|---|---|---|
-Dallow-gdt |
false |
Enable the in-game debugging tool, invoked by typing gdt. Not much use except for debugging. |
-Doptimize=... |
Debug |
Standard Zig optimization mode, e.g. ReleaseSafe or ReleaseFast. |
-Dtarget=... |
native | Standard Zig cross-compilation target. |
Nix
A flake is included:
# Play the game
nix run .#zig-zork
# Build the package
nix build .#zig-zork
# Development shell with Zig, termcap, and tooling
nix develop
The flake builds with Zig's --system mode using dependencies pre-fetched via
zon2nix; after changing dependencies in
build.zig.zon, regenerate build.zig.zon.nix with zon2nix.
Playing
You are standing in an open field west of a white house, with a boarded front
door. Type commands like open mailbox, go north, or take lamp. See the
dungeon(6) manpage for details, or type help in-game. Save yourself some
grief: don't wake the thief.