Output Filtering

version 2 by Ron Newcomb

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - The Output Processing Rulebook's default rules

    The output processing rules are a rulebook.

    An output processing rule (this is the Autocapitalization rule):
        replace the regular expression "(<\.\?\!>)(<\s'{\<}>+)(\l)" in the game's response with "\1\2\u3";
        replace the regular expression "^(<\s'{\<}>*)(\l)" in the game's response with "\1\u2". [for the very first letter of the captured text]
        [NOTE: in the above, \1 is a lower-case L in the regex and the number One in the replacement! I7's font shows them identically. ]

    [ to type ¶ on Mac keyboard, hold Option, type 7 ]
    [ to type ¶ on Win keyboard, hold ALT, type 0182, release ALT ]

    An output processing rule (this is the Paragraph Break rule):
        if not using no blank lines option, replace the regular expression "\[BLANK LINE]" in the game's response with "\n\n\[BLANK LINE]";
        replace the regular expression "\n{3,}" in the game's response with "\n\n"; [ single-function search should be faster, and ensure it's "3 or more" not "2 or more"!! ]
        replace the regular expression "\n{2,}$" in the game's response with "\n"; [ the command prompt tends to print its own line break before itself, so we enforce only one break beforehand ]
        if not using no blank lines option, replace the regular expression "\[BLANK LINE]" in the game's response with "\n".