Rapid Prototyping

version 1 by B David Paulsen

  • Home page
  • Beginning
  • Previous
  • Next



  • Book - Mapping
    When play begins:
        repeat with item running through rooms:
            if the true-name of the item is empty, now the true-name of the item is "[printed name of item]";
        repeat with item running through things:
            if the true-name of the item is empty, now the true-name of the item is "[printed name of item]".
    [Creating a map and source text.]
    The initial location is an object that varies.
    When play begins: now the initial location is the location of the player.
    Checked rooms is a list of rooms that varies.
    Definition: a room is unchecked if it is not listed in checked rooms.
    Definition: a thing is non-player if it is not the player.
    To decide which list of texts is adjacent-rooms-with-dir of (origin - a room):
        let L be a list of texts;
        repeat with r running through not unchecked rooms adjacent to origin:
            let d be the best route from r to origin;
            let t be "[printed name of d] of [true-name of r]";
            add the substituted form of t to L;
        decide on L.
    To recursively map from (r - a room), finally:
        let name be the true-name of r;
        if all rooms adjacent to r are unchecked:
            if the name matches the text "[the singular of the object kind of r]":
                say "There";
            otherwise:
                say "[name]";
            say " is a room. ";
        otherwise:
            say "[name] is [adjacent-rooms-with-dir of R]. ";
        if name is not the printed name of the r:
            say "The printed name of [name] is '[printed name of the r]'. ";
        if not finally:
            say "The true-name of [name] is '[name]'.[line break]";
        otherwise:
            say "[line break]";
        if the description of the R is not empty, say "The description of [name] is '[description of R]'";
        say line break;
        repeat with item running through non-player things held by R:
            if the item is not the locality:
                say line break;
                if not finally:
                    recursively item-map the item;
                otherwise:
                    recursively item-map the item, finally;
        say line break;
        add r to checked rooms;
        let L be a list of rooms;
        add the list of (unchecked rooms which are adjacent to r) to L;
        if the number of entries in L is not 0:
            repeat with place running through L:
                if the place is unchecked:
                    if not finally:
                        recursively map from place;
                    otherwise:
                        recursively map from the place, finally.
    To recursively item-map (item - an object), finally:
        let nm be the object kind of the item;
        let L be a list of texts;
        if the item is not a backdrop:
            if the item is scenery:
                 add "scenery" to L;
            if the item is not scenery and the item is fixed in place:
                add "fixed in place" to L;
            if the item provides the property enterable and the item is enterable:
                add "enterable" to L;
            if the item is a thing and the item is proper-named:
                add "proper-named" to L;
        let x be "[if the item is improper-named]The [end if][true-name of the item]";
        let x_lc be "[if the item is improper-named]the [end if][true-name of the item]";
        say "[x] is a [if L is not empty][L] [end if][the singular of nm]. ";
        if not finally:
            say "The true-name of [x_lc] is '[true-name of item]'. ";
        if the item is worn by someone (called the wearer), say "[X] wears the [true-name of item]";
        if the item is part of something (called the incorporator), say "[X] is part of [the true-name of the incorporator]";
        if the item is on something (called the supporter), say "[X] is on [the true-name of the supporter]";
        if the item is in a thing (called the container), say "[X] is in [the true-name of the container]";
        if the item is in a room (called the place), say "[X] is in [the true-name of the place]";
        say ".[run paragraph on][if the description of the item is not empty] The description of [x_lc] is '[description of the item]'[end if][line break]";
        if the item provides initial appearance:
            if the initial appearance of the item is not empty, say "The initial appearance of [x_lc] is '[initial appearance of the item]'[line break]";
        if the true-name of the item is not the printed name of the item:
            say "The printed name of [x_lc] is '[printed name of the item]'.[line break]";
        repeat with next-item running through things held by the item:
            say line break;
            if finally, recursively item-map the next-item;
            otherwise recursively item-map the item, finally.
    Intermediate compiling is an action out of world. Understand "view code/source" as intermediate compiling.
    Carry out intermediate compiling:
        while there is an unchecked room which is placed:
            if there are no not unchecked placed rooms:
                recursively map from the initial location;
            otherwise:
                recursively map from a random unchecked placed room;
        truncate the checked rooms to 0 entries.
    Final-compiling is an action out of world. Understand "view code/source finally" as final-compiling.
    Carry out final-compiling:
        while there is an unchecked room which is placed:
            if there are no not unchecked placed rooms:
                recursively map from the initial location, finally;
            otherwise:
                recursively map from a random unchecked placed room, finally;
        truncate the checked rooms to 0 entries.