It is now possible in the YAML to declare defines for all state values
associated with an object. This are visible in the C code and can be used
to replace magic numbers.
Say "Nothing happens" on "foo" not in Giant Room, rather than "What's
the matter, can't you read? Now you'd best start over." which only
makes sense there.
It would be funnier to say something like "Well, that was remarkably
pointless." Maybe later.
The problem wasn't actually with "eat" but with "grate". Processing
of any two-word command with an object of "grate", when given at certain
locations including the start, inappropriately jumped directly
to the movement code (ignoring the verb).
There was a similar bug in the ancestral 2.5, though it manifested slightly
differently.
This (sort of) documents the fact that, unlike say() and attack(),
read() never scribbles on the interpreter's command block.
What those other functions are doing is unclean - though less so than
fully exposed globals. I don't see a way to fix it that isn't pretty
intrusive, alas.
The token_t things like WD* are presently longs and will someday be
char[6]. By introducing some trivial functions - wordeq(),
wordempty(), and wordclear() - we mostly hide the difference.
All runtime knowledge about packing now lives only in misc.c and the
list of magic WORD_* defines in advent.h. Outside this, literals are
now accessed through #define names that could expand to either longs
or strings.
Still to be done: WD* values are sometiimes compated to zero in
ways implying they can be negative. Must figure out wat thus means.
Show usage when using bad parameter with ./advent
Converted magic numbers to enums for BUG(). Also bug now shows
stringify'ed version of bug enumeration (not just a number).
Moved prototypes for initialise() and action() from main.c to advent.h
Made the following functions static, so they wouldn't require prototypes:
sig_handler (main.c)
spotted_by_pirate (main.c)
light (actions.c)