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