How to parse user commands in a text adventure?
Parsing user commands in a text adventure is a spectrum from Adventure ‘s simple “go north” to some mind-bogglingly clever ones in hhgttg. I seem to remember reading nice how-tos in computer magazines back in the 80s, but now I find almost nothing on the ‘net except a brief Wikipedia ref.
Where can I find the Inform 7 parser?
The Inform 7 parser is closely integrated with the Inform 7 IDE, and the entire source code is not available for study yet: It is written in inweb, a custom-designed literate language. Inweb’s source is publicly available. Some, but not all, of the webs for Inform 7 are available.
How does the text adventure processor program work?
The way text adventure processors actually work is first you write a program that breaks the sentence typed by the user up into tokens. You have to search through the string character by character looking for boundaries between words, like spaces, commas, periods, and so on.
Which is the best way to parse a grammar?
The above is a variant on Backus-Naur form, the standard way of representing grammars. Anyway, you can use a parser generator to generate code to parse this grammar, or write your own fairly easily if your language has decent string handling. (Look up ‘recursive descent parsers’, which use one function for each line of the grammar.)
Where can I find the parser in mud 2?
If you search the major forums for those (Intfiction.org/forum, the newsgroup rec.arts.int-fiction, Mud Connector, Mudbytes, Mudlab, Top Mud Sites) you’ll find some answers, but if you’re just looking for articles I would recommend Richard Bartle’s explanation of the parser in MUD II: And this explanation on rec.arts.int-fiction:
Which is the best language to write text adventures in?
If your goal is to write a text adventure, then don’t use C#, use Inform7. It is easy to learn, specifically designed to write text adventures, and is probably the most high level language in the world. It is an amazing programming language and I highly recommend it.