>EXAMINE ORGAN-GRINDER
The first room has an organ and an organ-grinder. I wanted to allow the player to refer to the grinder as "grinder," "organ grinder," and "organ-grinder." What I found, though, is that ZILF did not like ORGAN-GRINDER as a synonym; it did not like the dash in the definition.
For this problem, I needed Jesse McGrew's help. He gave me the following code to be inserted before "parser.zil" is included.
The above code looks for a dash as the sixth character of a word then replaces it with the word of our choice. As you can see in the comments, it originally put in the fake synonym "O.GRINDER" but since there really wasn't any reason it couldn't just be changed to "GRINDER," I changed it to that.
Anyhow, a parsing trick like that could be very useful to someone at some point!
Ok, I was thinking I could also write something about DESCFCNs (where routines are used for object descriptions), but I see now that it was shown pretty well in the juggler code I shared in the other entry.
So yeah, that's all my ZIL for now!
No comments:
Post a Comment