Sample output:
- Your quest is:
you must find Netscape Navigator and bring it to Wynn Athen
- Your quest is:
you must slay the Daemon High Council which is lurking in Bryn Mawr
- Your quest is:
you must capture a herring which is lurking in MIT and Your quest is:
you must murder the Windows 95 Source Code which is lurking in Bel Mawr
- Your quest is:
you must capture Demitar which is lurking in Brynwood and Your quest is:
you must slay the Daemon High Council which is lurking in MIT
- Your quest is:
you must slay a herring which is lurking in Belmore
- Your quest is:
you must kill a kitty which is lurking in Bel Athen
- Your quest is:
you must slay a kitty which is lurking in MIT
- Your quest is:
you must find Netscape Navigator and bring it to Slashdot and Your quest is:
you must find the West Wind and bring it to MIT
- Your quest is:
you must capture the West Wind which is lurking in Slashdot
- Your quest is:
you must find the West Wind and bring it to Cynwyd
- Your quest is:
you must find a herring and bring it to Slashdot
- Your quest is:
you must capture the Daemon High Council which is lurking in MIT
- Your quest is:
you must capture the West Wind which is lurking in MIT and Your quest is:
you must kill the Daemon High Council which is lurking in MIT
- Your quest is:
you must find a cellular phone and bring it to MIT and Your quest is:
you must kill the blue pill which is lurking in Slashdot and Your quest is:
you must find a cellular phone and bring it to Slashdot and Your quest is:
you must find the STAGE Server and bring it to MIT
- Your quest is:
you must find a herring and bring it to Slashdot and Your quest is:
you must slay Netscape Navigator which is lurking in MIT
Instructions
In the textbox, enter a list of productions. A production looks like:
HotColor = Red | "royal" Blue | "purple"
The blue part on the left is the name of the production. The red part on the right is what the production should be replaced with. It consists of a list of alternatives separated by |. Alternatives are concatenations of terminals (literal strings in double-quotes, like "royal" and "purple") and nonterminals (production names, such as Red and Blue). Parentheses act as groups. The following production would have a 50% chance of choosing Nader and a 25% chance each of choosing Gore or Bush:
President = Nader | (Gore | Bush)
Productions can also take comma-separated formal parameter lists (in which case they are called functions), such as:
OneThird { param } = param | "" | ""
The green part in curly braces is the parameter list. During evaluation, each formal parameter is replaced by the corresponding value passed to the production in square braces. Example:
Purple = PickOne ["Your money", "Your life"]
In this case, the function PickOne is called with nonterminals "Your money" and "Your life" as parameters.
I don't think this adds any mathematical power, just convenience.
If you screw up, paste in one of the old grammars.
Source Code