Okay, I’ve decided to paste my ZIL example into this topic. Be warned though, it’s very silly. Here goes.
"Pick Up the DECsystem-20 and Die"
"A Very Simple and Silly ZIL Example Game"
"Written April 18, 2010 by Jayson Smith"
"Requires ZILF 0.3 and its associated library."
"First we specify the Z-code version."
"Here, ZIP means Z3."
<VERSION ZIP>
"Here is the release number."
<CONSTANT RELEASEID 1>
"Now we specify the game banner."
<CONSTANT GAME-BANNER
"Pick Up the DECsystem-20 and Die|
A Simple and Silly ZIL Example Game by Jayson Smith">
"A ZIL Program always starts with a routine named GO."
<ROUTINE GO ()
<CRLF> <CRLF>
<TELL "Through a time warp, you have been transported back to 1984.
Even more amazing than that, you have entered the offices of the legendary game publishing company Infocom.
What's more, you have just accepted a job as an implementer... Wait a minute, this must be a parallel universe.
At any rate, you are taken to complete your final test. The company's DECsystem-20 mainframe is here.
Just don't pick it up, or else you'll die. Yeah, definitely a parallel universe." CR CR>
"The V-VERSION routine prints the game banner and version information."
<V-VERSION> <CRLF>
"Now we establish the player's initial location."
<SETG HERE ,INFOCOM>
<MOVE ,PLAYER ,HERE>
"Give the player the room's description."
<V-LOOK>
"Here's the main loop, which processes player input and calls appropriate routines."
"This loop repeats until the game ends."
<REPEAT ()
<COND (<PARSER>
<PERFORM ,PRSA ,PRSO ,PRSI>
<APPLY <GETP ,HERE ,P?ACTION> ,M-END>
<OR <META-VERB?> <CLOCKER>>)>
<SETG HERE <LOC ,WINNER>>>>
"And now, allow me to introduce the world model."
<INSERT-FILE "parser">
"Objects"
"The room where this game takes place."
<ROOM INFOCOM
(IN ROOMS)
(DESC "Infocom Headquarters")
(LDESC "A large room in the headquarters of Infocom.")
(FLAGS LIGHTBIT)>
"Now here's an object we can play with."
<OBJECT DEC20
(DESC "DECsystem-20")
(IN INFOCOM)
(FDESC "The DECsystem-20 mainframe is chugging away as the implementers work.")
(SYNONYM DECSYSTEM COMPUTER MAINFRAME MACHINE)
(FLAGS TAKEBIT)
(ACTION DEC20-R)>
<ROUTINE DEC20-R ()
"This routine is one big COND. We're checking if the verb is various things, and
taking appropriate actions."
<COND (<VERB? EXAMINE>
<TELL "Several large machines make up Infocom's mainframe. Within is stored, among other things,
the source code and story files for all games, design documents, development tools, and
other things the public will never see. If it were damaged, Infocom's work would definitely be disrupted.">)
(<VERB? TAKE>
<TELL "You pick the most important-looking of the machines and start to lift it up.
At that moment, your superhuman powers, which you didn't know you had until this instant, kick in.
You are able to lift the machine high above your head. However, the effects are short-lived,
and it falls on your head, squishing you." CR>
"Now we call JIGS-UP, since the player is now a pancake."
<JIGS-UP "Maybe that wasn't such a good idea after all.">)
(<VERB? PUSH>
<TELL "You push on the most important-looking of the machines, and finally, you get it to fall over with a resounding CRASH!
The implementers all rush in to see what's going on. They find the fallen machine,
and start to tell you to get out of the building right now!" CR>
<TELL "Just then, a time warp opens up, and you jump through it.
Now you're sitting back in front of your computer... Guess you just can't have it all." CR CR>
<TELL "Thanks for playing this silly demo game!" CR>
"So the player has won... or at least, reached the happier of
this game's two endings. So we exit outright."
<QUIT>)>>