-- Alan Tutorial -- file : lesson6.ala -- Lesson 6 example program -- checks in take verb etc -- object synonyms -- and syntax of put x in y OBJECT ATTRIBUTES Takeable. LOCATION Street NAME A City Street DESCRIPTION "Either side of the street is full of shops. The shops are a typical mixture of old houses converted into trendy boutiques and a few new glass-fronted shopping arcades. The exception is one house, to the north of you, which looks like a deserted house. A sign on the front door says $n$tPrivate $n$tThis is my home$n$tDon't Annoy Me!$p" EXIT north TO Porch. END LOCATION. SYNONYMS can=tin. garbage=rubbish. note=notepaper. paper=notepaper. 'message'=notepaper. OBJECT Note NAME Notepaper AT Street DESCRIPTION "There is a piece of grubby notepaper here with some scrawled writing on it." VERB Read DOES IF Note NOT IN Inventory THEN LOCATE Note IN Inventory. "(You pick up the piece of notepaper.)$p" END IF. SCORE 5. "The scrawled handwriting is very bad but you think the message reads$p $t'I hate what you people have done to my street. $n$tYou're not going to have my house as well. I'd rather be dead. $n$tI'd rather you people were dead too! $n$tGood bye people!' $pHmmm .. that's a scarey little message!" END VERB Read. VERB eat CHECK Note in Inventory ELSE "You don't have that." DOES LOCATE Note AT Nowhere. "The note is surprisingly tasty. But, now that you think about it, eating it was rather pointless." SCORE 5. -- hey how can that be 'pointless'!! (sample 'bug') END VERB. END OBJECT. OBJECT Tin NAME Rubbish Tin AT Street CONTAINER IS NOT Takeable. DESCRIPTION "A rubbish tin is bolted to one side of a lamppost." LIST Tin. END OBJECT. OBJECT Bomb AT Street IS NOT Takeable. DESCRIPTION "There is bomb securely bolted to a lamp post." END OBJECT. LOCATION Porch NAME Front Porch DESCRIPTION "The unpainted wood of the porch is rotting and feels like it could crack under your weight at any moment. The front door of the house, however, seems newly installed and very strong." SCORE 5. EXIT south TO Street. END LOCATION Porch. SYNONYMS place=put. SYNTAX put=put (obj1) 'in' (obj2) WHERE obj1 ISA Object ELSE "You don't have that." AND obj2 ISA Container ELSE "You can't put things in there." VERB put CHECK Obj1 IN Inventory ELSE "You don't have the $1." AND Obj2 HERE ELSE "The $2 is not here." DOES LOCATE obj1 IN obj2. END VERB. SYNONYMS get=take. SYNTAX take=take (obj)*. VERB take CHECK Obj IS Takeable ELSE "You can't take that." AND Obj NOT IN Inventory ELSE "You already have it." DOES "You take the $o." LOCATE Obj IN Inventory. END VERB. SYNONYMS throw=drop. VERB drop CHECK OBJECT in Inventory ELSE "You don't have that." DOES "You drop the $o." LOCATE OBJECT HERE. END VERB. LOCATION Nowhere END LOCATION. SYNTAX list_inventory=inventory. SYNONYMS i=inventory. VERB list_inventory DOES LIST Inventory. END VERB. $INCLUDE 'library1.ala' START AT Street. VISITS 99.