Input (grammar) looks like this: Apology ::= my (cat|mouse|monkey) ate my homework. Apology ::= our (basement|attic|third floor) collapsed from an overload of school books. Pseudo-code: Put the grammar into array "rules". Choose one of the rules (randomly). Parse rule: Apology ::= <bla> Parse bla into: #1 (...) #2 everything else With every s in #1 do: Split inner part of s at "|" into "options". Choose one of the options (randomly). Replace s with option. Print bla (with the replacements made).
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Recognizer | Recognition Result | Visualize | Recalc |
|---|---|---|---|
| #308 | 530 | [visualize] |
| Snippet ID: | #231 |
| Snippet name: | Executor for apology generator |
| Eternal ID of this version: | #231/1 |
| Text MD5: | 30720edef91db4ed7dca7f4772a4dec1 |
| Author: | stefan |
| Category: | Apology generators |
| Type: | Document |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2014-02-03 22:41:22 |
| Source code size: | 530 bytes / 18 lines |
| Pitched / IR pitched: | No / Yes |
| Views / Downloads: | 1121 / 258 |
| Referenced in: | [show references] |