Rapid Prototyping

version 1 by B David Paulsen

  • Home page
  • Beginning
  • Previous
  • Next



  • Part - New actions
    Chapter - Text properties
    Every thing has a text called the true-name.
    Every room has a text called the true-name.
    Understand the printed name property as describing a thing.
    Understand the true-name property as describing a thing.
    When play begins:
        if the true-name of the location is empty:
            now the true-name of the location is "[the singular of the object kind of the location]".
    Locality is a backdrop. It is everywhere and privately-named. Understand "location" as locality.
    The printed name of the locality is "[location]".
    The true-name of the locality is "[true-name of location]".
    The item-in-question is an object that varies.
    Understand the command "describe" as something new.
    Item-description is an action applying to one thing.
    Understand "describe [something]" as item-description.
    Describing is a truth state variable. Describing is false.
    Carry out item-description:
        if the noun is the locality, now the item-in-question is the location;
        otherwise now the item-in-question is the noun;
        say "Describing the [the singular of the object kind of the item-in-question] '[bold type][item-in-question][roman type]':[line break](press RETURN once for paragraph break, or twice to stop typing)";
        if the description of item-in-question is not empty, say "[line break]([italic type]after the text[roman type] '[description of the item-in-question]')";
        now describing is true.
    Rule for printing a parser error when the latest parser error is the I beg your pardon error and describing is true:
        now describing is false;
        say "Updated.";
        try looking.
        
    After reading a command when describing is true:
        let x be the substituted form of the description of the item-in-question;
        let pc be the substituted form of the player's command;
        let n be the number of characters in x;
        let y be "[the substituted form of x][if n is not 0][paragraph break][end if][pc]";
        if character number 1 in y is " ", replace character number 1 in y with "";
        now the description of the item-in-question is the substituted form of y;
        if the Testing Correction option is active, now the description of the item-in-question is the description of the item-in-question in sentence case;
        reject the player's command.
        
    Understand the command "undescribe" as something new.
    Description-clearing is an action applying to one thing.
    Understand "undescribe [something]" as description-clearing.
    Carry out description-clearing:
        if the noun is the locality, now the noun is the location;
        now the description of the noun is "";
        say "Cleared.";
        try looking.
    Item-renaming is an action applying to one thing and one topic.
    Understand "name [something] [text]" as item-renaming.
    Carry out item-renaming:
        let subject be an object;
        if the noun is the locality:
            let the subject be the location;
        otherwise:
            let the subject be the noun;
        if the topic understood matches the text "|":
            let s be the substituted form of the topic understood;
            let t be s;
            replace the regular expression "\|.*" in s with "";
            replace the regular expression ".*\|" in t with "";
            now the printed name of the subject is s;
            now the true-name of the subject is the t;
        otherwise:
            let w be word number (number of words in the topic understood) in the topic understood;
            now the printed name of the subject is the topic understood;
            now the true-name of the subject is the w.
    Report item-renaming:
        say "Updated.";
        try looking.
    Item-appearance-editing is an action applying to one thing and one topic.
    Understand "appearance [something] [text]" as item-appearance-editing.
    Carry out item-appearance-editing:
        now the initial appearance of the noun is the topic understood;
        if the initial appearance of the noun is not empty and character number 1 in the initial appearance of the noun exactly matches the text "#", replace character number 1 in initial appearance of the noun with "";
        if the Testing Correction option is active, now the initial appearance of the noun is the initial appearance of the noun in sentence case.
    Report item-appearance-editing:
        say "Updated.";
        try looking.