| Crates.io | marzipan |
| lib.rs | marzipan |
| version | 0.1.0 |
| created_at | 2025-07-21 08:07:04.612054+00 |
| updated_at | 2025-07-21 08:07:04.612054+00 |
| description | A macro processor for ZZT worlds |
| homepage | |
| repository | https://github.com/cmounce/marzipan |
| max_upload_size | |
| id | 1761844 |
| size | 259,993 |
Marzipan is a macro processor for ZZT. It extends the ZZT-OOP scripting language while still maintaining compatibility with ZZT 3.2: all language features compile down to vanilla ZZT-OOP.
:@ defines a label with a unique name, and @f/@b reference the nearest anonymous label forward/backward of the current line..loop multiple times in a single object's code.
Marzipan will replace this with a distinct name per section: loop_ in one section, loopa in the next section, etc.% invoke a Marzipan macro.
Macros work by text substitution; for example, %include "foo.txt" will insert the contents of a text file at the current line.Here's an example of what anonymous labels look like in practice:
@Treasure chest
#end
:touch 'Event handler, user touched the chest.
#if key @f 'Jump to anonymous label. Marzipan compiles `@f` to `_`...
The chest is locked.
#end
:@ '...and compiles this to `:_`.
You unlock the chest.
There's a bunch of gems inside!
#give gems 20
#die
:shot 'Event handler, user shot at the chest.
#if shotgun @f 'This time, Marzipan compiles `@f` to `a`...
Nothing happens.
#end
:@ '...and compiles this to `:a`.
The chest shatters!
Gems fly everywhere.
#put w green gem
#put e green gem
#become green gem
Marzipan reads and writes ZZT world files, a binary file format. You will need either ZZT itself or an external ZZT editor (such as KevEdit) to work with them.
marzipan WORLD.ZZT -o ./dest_folder/WORLD.ZZT
A disclaimer: Marzipan is experimental. It hasn't eaten my code yet, but I cannot guarantee it will treat your code with kindness. If you use it, make sure to keep backups of your work. (You were already keeping backups, right?)