[MUD-Dev] Re: (fwd) Re: command parsers: a modest proposal (with apologies to J. Swift)

Richard Woolcock KaVir at dial.pipex.com
Wed Jul 8 19:24:06 CEST 1998


Richard Bartle wrote:
> 
> Chris Gray <cg at ami-cg.GraySage.Edmonton.AB.CA> wrote:
> 
>  >I don't actually build lists of matching nouns and then restrict based on
>  >adjectives - I do my searching with the adjectives in effect. Consequence:
>  >I don't currently support notions like "all but".
>         This is a good technique for databases in general, as it can mean the
> entire database doesn't get searched twice. In a MUD where locality gives a
> reasonably small data structure, though, it's not a problem.
> 
>  >In "drop rock", it seems MUD2 would drop all rocks.
>         That's right, it would.
> 
>  >What are the choices here:
>  >   - drop all of them
>  >   - complain about ambiguity
>  >   - drop some "random" rock
>  >   - allow the user to choose
>         Of these, the second and fourth get in the way of the game. The real
> choice is between the first and the third. I chose the first because it fell
> naturally from the way I was processing adjectives and so on as operators
> applied to sets of candidate objects. Once players got used to it, switching
> to another version was not an attractive option.
>         If I were to rewrite the parser for a new MUD, though, I think I'd
> take plural forms into account, ie. DROP ROCK drops one, DROP ROCKS drops
> them all. There would have to be some minor messing about for cases like
> DROP EVERYTHING, but nothing intractable.

As limited as my parser is, it *can* handle the above.  The following would
work: "drop knives" (drop all knives), "drop knife" (drop one knife), "drop 
three knives" (drop three knives), "drop three knife" (drop the third knife).

Unfortunately "drop knive" would drop one knife, and "drop knifes" would drop
all knives.  I use "everything" to represent everything you are carrying;
"all" is used only in the context "drop all knives" (which you might as well
use "drop knives" for, now that I think about it).

In another post, Ross Nicoll wrote:
> Fine, until someone wants to drop more than one mouse (well, would you want
> to be wandering around with a load of mice? :) ).

This is something my parser couldn't handle.

> You could have fun with gloves, too; unless you have right glove and left
> glove objects, you're likely to have a "pair of gloves" object.

Nope I have two separate glove objects.  "trousers" are a pain though, although
you could type "get one pair of trousers".

> There's also the possibility of a plural that has an extra "es" instead of
> just "s" on the end, but I can't think of an word to use as an example.

My parser can handle "torches" rather than "torch", but it was a bit hacky to
add.

KaVir.




More information about the mud-dev-archive mailing list