Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
continue;
3 3
Verbs and Actions Other useful directives File structure
To specify a new verb: To include a directive within a routine definition [...], A minimal source file:
Verb 'verb ' 'verb ' ... 'verb ' insert a hash # as its first character. Constant Story "MYGAME";
* token token ... token > action To conditionally compile: Constant Headline "^My first Inform game.^";
* token token ... token > action Constant MANUAL_PRONOUNS;
Ifdef name ; ! use any one of these
...
Ifndef name ; !
* token token ... token > action ; Include "Parser";
Iftrue expr ; !
Include "VerbLib";
where instead Verb can be Verb meta, action can be Iffalse expr ; !
action reverse; tokens are optional and each is one of: ...
[ Initialise; location = study; "^Hello!^"; ];
Ifnot;
'word ' that literal word
'w1 '/'w2 '/... any one of those literal words ... Class Room
Endif; with description "A bare room."
attribute an object with that attribute
To display a compile-time message: has light;
creature an object with animate attribute
held an object held by the player Message "string "; Class Furniture
noun an object in scope To include the contents of a file, searching the Library path: with before [; Take,Pull,Push,Pushdir:
noun=routine an object for which routine returns true print_ret (The) self,
Include "source_file "; " is too heavy for that."; ]
scope=routine an object in this re-definition of scope has static supporter;
To include the contents of a file in the same location as the
multiheld one or more objects held by the player current file:
multi one or more objects in scope Room study "Your study";
Include ">source_file ";
multiexcept as multi, omitting the specified object
To specify that a library routine is to be replaced: Furniture "writing desk" study
multiinside as multi, omitting those in specified object
Replace routine ; with name 'writing' 'desk' 'table';
topic any text
number any number To set the games release number (default is 1), serial Object > > axe "rusty axe"
routine a general parsing routine number (default is todays yymmdd ) and status line format with name 'rusty' 'blunt' 'axe' 'hatchet',
(default is score): description "It seems old and blunt.";
To add synonyms to an existing verb: Release expr ;
Verb 'verb ' 'verb ' ... = 'existing_verb '; Serial "yymmdd "; Include "Grammar";