Sample output:
- Your quest is:
you must find a cellular phone and bring it to Slashdot and Your quest is:
you must slay the Daemon High Council which is lurking in Slashdot and Your quest is:
you must find a cellular phone and bring it to Wynn Mawr
- Your quest is:
you must find Netscape Navigator and bring it to MIT
- Your quest is:
you must kill the Windows 95 Source Code which is lurking in Slashdot and Your quest is:
you must find a herring and bring it to Glad Athen and Your quest is:
you must find the STAGE Server and bring it to MIT
- Your quest is:
you must kill the Daemon High Council which is lurking in Wynn Mawr and Your quest is:
you must find the STAGE Server and bring it to MIT
- Your quest is:
you must murder the STAGE Server which is lurking in Cynmore and Your quest is:
you must find Netscape Navigator and bring it to MIT and Your quest is:
you must find the blue pill and bring it to MIT
- Your quest is:
you must murder a cellular phone which is lurking in MIT and Your quest is:
you must murder Demitar which is lurking in Belmore
- Your quest is:
you must find a herring and bring it to Slashdot
- Your quest is:
you must slay a kitty which is lurking in Glad Mawr and Your quest is:
you must find the STAGE Server and bring it to Slashdot
- Your quest is:
you must find the blue pill and bring it to Slashdot and Your quest is:
you must find the STAGE Server and bring it to Penn Mawr and Your quest is:
you must find a cellular phone and bring it to MIT
- Your quest is:
you must find the West Wind and bring it to MIT and Your quest is:
you must murder Netscape Navigator which is lurking in MIT and Your quest is:
you must murder Satan's Little Helper which is lurking in MIT and Your quest is:
you must find the blue pill and bring it to Gladwyd
- Your quest is:
you must slay Demitar which is lurking in Bryn Athen and Your quest is:
you must murder a kitty which is lurking in Bel Mawr and Your quest is:
you must find the STAGE Server and bring it to Slashdot and Your quest is:
you must find the West Wind and bring it to Slashdot and Your quest is:
you must find a cellular phone and bring it to Belwood
- Your quest is:
you must find the STAGE Server and bring it to MIT
- Your quest is:
you must murder a cellular phone which is lurking in MIT and Your quest is:
you must murder the Daemon High Council which is lurking in MIT and Your quest is:
you must find the West Wind and bring it to Slashdot and Your quest is:
you must find a herring and bring it to Slashdot and Your quest is:
you must capture Satan's Little Helper which is lurking in Slashdot
- Your quest is:
you must slay Satan's Little Helper which is lurking in Wynnmore and Your quest is:
you must find Netscape Navigator and bring it to MIT and Your quest is:
you must capture a kitty which is lurking in Slashdot and Your quest is:
you must find Netscape Navigator and bring it to Ard Athen
- Your quest is:
you must find the STAGE Server and bring it to Slashdot and Your quest is:
you must find the West Wind and bring it to Cynwyd and Your quest is:
you must kill Netscape Navigator which is lurking in Slashdot
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