1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-05-21 10:28:58 +03:00
inform7/resources/Documentation/Examples/Alpha.txt
2024-03-19 21:14:26 +00:00

26 lines
1 KiB
Plaintext

Example: * Alpha
Location: Regular expression matching
RecipeLocation: Testing
Index: Testing command
Description: Creating a beta-testing command that matches any line starting with punctuation.
For: Z-Machine
Sometimes we want to let testers of a game insert their own comments during a transcript, without those comments wasting turns of the game or producing lengthy or inappropriate parser errors. Many testers have a habit of prefacing comments with a punctuation mark, so let's say that we'd like to catch any command that starts with any punctuation at all:
{*}"Alpha"
When play begins:
say "Hi, Larry! Thanks for testing my game!!"
Unimplemented Room is a room. "Room description goes here..."
The scary troll is a man in Unimplemented Room.
After reading a command (this is the ignore beta-comments rule):
if the player's command matches the regular expression "^\p":
say "(Noted.)";
reject the player's command.
Test me with "x me / x troll / !this game is a bit dull so far / kiss troll / ? does this troll do anything? / :yawn".