Rapid Prototyping

version 1 by B David Paulsen

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - Spontaneous room creation
    Digging is an action applying to one object.
    Understand "dig [direction]" as digging.
    Check digging:
        let dir be the noun;
        if the room dir from location is not nothing, say "There's already a room called [the printed name of room dir from location] in that direction." instead.
        
    Check digging when there is no unplaced room: say "Out of placeable rooms. Increase the limit and try again." instead.
    Carry out digging:
        let new-room be a random unplaced room;
        let dir be the noun;
        change the dir exit of the location to the new-room;
        change the opposite of dir exit of the new-room to the location;
        now the printed name of the new-room is "room";
        now the true-name of the new-room is "room #[number of on-stage rooms]";
        now the new-room is placed.
        
    Report digging:
        say "Updated. Going [noun].";
        try going noun.
        
    Dig-connecting is an action applying to two objects.
    Understand "dig [direction] [any room]" as dig-connecting.
    Check dig-connecting:
        let dir be the noun;
        if the room dir from location is not nothing, say "There's already a room called [the printed name of room dir from location] in that direction." instead;
        if the room opposite of dir from the second noun is not nothing, say "There's already a room called [the printed name of room opposite of dir from the second noun] in that direction from [the second noun]." instead.
        
    Carry out dig-connecting:
        let dir be the noun;
        change the dir exit of the location to the second noun;
        change the opposite of dir exit of the second noun to the location.
    Report dig-connecting:
        say "Updated.";
        try looking.
    Understand the printed name property as describing a room.
    Understand the true-name property as describing a room.