"as a mistake"

I’m getting an unexpected inconvenience here for as-a-mistake code:

[code]“ecard” by Andrew

understand “e cards” as a mistake (“That’s a silly anagram.”) when player is in sacred cedars.

room 1 is a room. sacred cedars is east of room 1.[/code]

If I try to type E, it doesn’t work anywhere. However, GO E does. The parser seems to think e is trying to mean e cards, which throws an error.

This is an obvious edge cases but it threw me–am I missing something obvious? I suppose I can tack on

[code]understand the command “e” as something new.

understand “e” as egoing.

egoing is an action applying to nothing.

carry out egoing:
try going east;[/code]

After, which works but is inelegant.

Anyone care to tell me how I could/should do this more concisely?


“As a mistake” generates verb grammar. Directions are not verb grammar, they’re checked later in the parsing process, after all verbs have failed to match. So when “e” is a verb, it supersedes “e” as a direction action.

The solution you’ve found is the simplest way to cope, as far as I know.

In I6, it would be more elegant to check this sort of input as a set of objects analogous to directions. This would require I6 hacking, of course.

Ah, great, thanks again! It’s good to know why things aren’t trivial, and this makes a ton of sense.

Your suggestion would be an interesting future project for me to try.