Output Filtering

version 2 by Ron Newcomb

  • Home page
  • Beginning
  • Previous



  • Example: * Navel Gazing - Tests extension, highlights limitations.

        "navel gazing"

        Include Output Filtering by Ron Newcomb. [Use no blank lines.] [Use output filter debugging. ] [Use banner text filtering.]

        When play begins, change the command prompt to "[bold type][if output filtering is on]on[otherwise]off[end if][roman type]>".

        Before printing the banner text, say "once upon a time...[line break][line break]".

        room heading is a room. "you notice the room heading was capitalized. and the first sentence was capitalized in spite of the room heading not ending in a period, exclamation mark, or question mark. "

        A horse is a supporter in room heading. "[line break][line break]here appears to be two spurious leading line breaks (removed), a horse with no name...[blank line]...and exactly one extra blank line. you can also see [bold type]bold[roman type] and [italic type]italic[roman type] text here."

        Has-whispered is a truth state that varies. Has-whispered is false.
        Understand "whisper" as a mistake ("the horse whispers his name back to you. he also mentions that all variables of yours will now be set long before any text is printed. This means say phrases with side effects, such as the [learn Argo]'learn Argo' code, essentially occur at the beginning of the enclosing phrase.").
        To say learn Argo: now has-whispered is true.

        An output processing rule (this is the Known Name rule):
            if has-whispered is true, replace the regular expression "\b(a|the)\s+horse" in the game's response with "Argo", case insensitively.

        Understand "breaks" as a mistake ("and then (break)[line break]something (2 breaks)[line break][line break][bold type]really[roman type] happened! (3 breaks)[line break][line break][line break]").

        Understand "speak" as a mistake ("'capitalize me when I'm talking to you!'[line break][line break]'all my [italic type]friends[roman type] use [italic type]screenplay[roman type] style, and [italic type]they[roman type] don't capitalize!'[line break][line break]'we don't care what your friends do or don't use. you will capitalize after double-quotation marks!'").

        Test me with " l/ breaks / speak / whisper / output filtering / l / breaks / speak / whisper ".