I thought this would be a fun little exercise, and it was. I chose to aim for Z-code version 5 only. If one really wanted to make this a version 3 game, it could be adapted to v3 in ten minutes or so.
Program part 1:
Constant Story "Mini-Cluedo";
Constant Headline "^A PunyInform demonstration.^";
Constant STATUSLINE_SCORE; Statusline score;
Constant NO_SCORE = 0;
!Constant DEBUG;
!Constant RUNTIME_ERRORS = 0; ! 0, 1 or 2. 0 = smallest file, 2 = most info
Constant OPTIONAL_NO_DARKNESS;
Constant OPTIONAL_ALLOW_WRITTEN_NUMBERS;
Constant OPTIONAL_GUESS_MISSING_NOUN;
Constant OPTIONAL_EXTENDED_METAVERBS;
Constant OPTIONAL_PROVIDE_UNDO;
Constant INITIAL_LOCATION_VALUE = Library;
Include "globals.h";
Global teleport_destination;
Global crime_scene;
Global killer;
Global room_count;
Property teleport_words;
Property chances;
First, set the name of the game and the headline, to be printed on game start.
Declare that we want the Score/Moves statusline rathern than the Time statusline, but then again, weâre going to replace the statusline anyway.
Say that we wonât be counting score in this game, we wonât have the concept of darkness (thereâs always light to see by), let the player type out numbers (e.g. âWAIT FIVEâ instead of âWAIT 5â) if they want, make the parser pick the object when itâs left out if itâs obvious (e.g. âQUESTIONâ with only one person present, means we want to question that person), add useful metaverbs like TRANSCRIPT etc, and provide an UNDO command.
We also choose to place the player in the Library.
Now weâve defined the necessary constants, and itâs time to include the first of two library files: globals.h
Then weâll set up four global variables, that we decided we need.
We will also need two new common properties for objects. We could start using them without declaring them - then they would become individual properties, which are a bit less efficient to use. We like efficiency ![]()
