ZORKplus
ZORK+ is a computer programming language developed by sadistic text-processing software technicians during the 1980's.
Variables[edit]
ZORK+ variables have no value as such, only location. Variables can be moved between locations by way of the INV push-down stack, but only if INV has enough room. Some variables can also act as a location. Variables cannot be created by the user, but only stumbled upon in certain locations.
The CRETIN Module[edit]
Manipulation of data is carried out by a special sequential access pointer called the CRETIN module (Computational REctilinear Transfer Input Node), which wanders to and fro o'er the predefined virtual dataspace. Experienced programmers may gain direct access to particularly valuable stores of data by judicious handling of all three of the CRETIN's coordinate registers, circumventing the many barriers which litter the dataspace like so many walls.
Syntax[edit]
ZORK+ statements are executed either sequentially in a list, or, more commonly, one command line at a time per user input. The basic syntax is a "verb-noun" structure which, except for special one-word control operators, must be adhered to. Unlike its predecessor ZORK, ZORK+ also supports a special 4-word command syntax (verb-noun-preposition-noun) for dynamic control of more than one variable.
Commonly-Used ZORK+ Commands[edit]
Sequential access register commands[edit]
- N: Increments the Y-coordinate register.
- S: Decrements the Y-coordinate register.
- E: Increments the X-coordinate register.
- W: Decrements the X-coordinate register.
- Note: The above commands may be used two at a time (at most) on the same control line, provided local circumstances permit.
- U: Increments the Z-coordinate register.
- D: Decrements the Z-coordinate register.
Input/output commands[edit]
- LOOK: Reads data from the memory location pointed to by the X & Y & Z registers, and prints to the screen.
- INV: Opens the user's INV stack for direct access by the CRETIN.
Dynamic data manipulation commands[edit]
- GET xxxxx: Attempts to retrieve data xxxxx from the current memory location and loads it into the INV file. If the selected data is inaccessible or badly formatted, the operating system returns the error message "I see no xxxxx here.".
- DROP xxxxx: Attempts to store data xxxxx from INV to the current memory location; nonexistence of the required data returns the error message "You don't have any xxxxx!".
- EAT xxxxx: Attempts to decompile certain types of data by passing them through the CRETIN module (which is very, very choosy). Using this command on the wrong class of data may result in either a harmless error message, or sudden catastrophic failure of the CRETIN. Caution: The effects of this command may cause irreversible lossage of data.
- ATTACK xxxxx WITH yyyyy: Specialized two-argument function; attempts to clear the variable xxxxx (resetting to 0), depending on the current status of yyyyy. If xxxxx and yyyyy are of incompatible types, the operating system will ridicule the user's ineptitude with a particularly insulting or sarcastic error message, and possibly terminate the program unexpectedly.
- PUT xxxxx IN yyyyy: Used for a specialized class of variable only. The user may specify nested recursive structures, provided that the variable yyyyy is pre-typed by the operating system as a "container".
Special control commands[edit]
- XYZZY: Special command with unpredictable effects; can be used only when the X & Y & Z registers have certain predetermined values (consult the online ZORK+ documentation for further details).
- PLUGH: Similar to XYZZY; can be implemented only if the operating system prompts the user in a hollow voice (audio card required).
- QUIT: Unconditionally terminates the program, and outputs the current value of the SCORE register.
Auxiliary ZORK+ Commands[edit]
There exists several other (undocumented) commands, but the typical user will need to utilize his feeble imagination to discover them.
Synopsis[edit]
Programming in ZORK+ can be an exceedingly frustrating exercise for the initiate; many unexperienced programmers simply give up in abject depair because the ZORK+ command interpreter is so bitchy and unyielding, and any intended positive results are seemingly far out of reach. However, the ZORK+ language has been proven to be Turing-complete, and thus effectively utilizable for all general-purpose data processing.
Real-world utilization[edit]
The on-board computers of the Mars rovers Spirit and Opportunity are programmed in ZORK+, and have suffered only one minor software glitch as a result.