mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	Include lots more forms of Inform7 syntax. Including embedded Inform6
syntax.
This commit is contained in:
		| @@ -1,6 +1,73 @@ | ||||
| Version 1 of Trivial Extension by Andrew Plotkin begins here. | ||||
| Version 2 of Trivial Extension by Andrew Plotkin begins here. | ||||
|  | ||||
| "This is the rubric of the extension." | ||||
|  | ||||
| "provided for the Linguist package by Andrew Plotkin" | ||||
|  | ||||
| [Note the two special quoted lines above.] | ||||
|  | ||||
| A cow is a kind of animal. A cow can be purple. | ||||
|  | ||||
| Understand "cow" as a cow. | ||||
| Understand "purple" as a purple cow. | ||||
|  | ||||
| Check pushing a cow: | ||||
| 	instead say "Cow-tipping, at your age?[paragraph break]Inconceivable." | ||||
|  | ||||
| [Here are the possible levels of heading:] | ||||
|  | ||||
| Volume One | ||||
|  | ||||
| Text-line is always "A line of text." | ||||
|  | ||||
| Book 2 | ||||
|  | ||||
| 	Part the third - indented headings still count | ||||
|  | ||||
| Chapter IV - not for release | ||||
|  | ||||
| [Heading labels are case-insensitive.] | ||||
|  | ||||
| section foobar | ||||
|  | ||||
| [A line beginning "Volume" that does not have blank lines before and after it is *not* a header line. So the following is part of section foobar:] | ||||
|  | ||||
| Measure is a kind of value. | ||||
| Volume is a measure. Length is a measure. | ||||
| Area is a measure. | ||||
|  | ||||
| [And now some Inform 6 inclusions.] | ||||
|  | ||||
| To say em -- running on: | ||||
| 	(- style underline; -). | ||||
| To say /em -- running on: | ||||
| 	(- style roman; -). | ||||
|  | ||||
| Include (- | ||||
|  | ||||
| ! Inform 6 comments start with ! marks and run to the end of the line. | ||||
| Global cowcount; | ||||
|  | ||||
| [ inform6func arg; | ||||
| 	print "Here is some text; ", (address) 'dictword', ".^"; | ||||
| 	cowcount++;  ! increment this variable | ||||
| ]; | ||||
|  | ||||
| Object i6cow | ||||
| 	with name 'cow' 'animal', | ||||
| 	with description "It looks like a cow."; | ||||
| 	has animate scenery; | ||||
|  | ||||
| -) after "Global Variables" in "Output.i6t". | ||||
|  | ||||
| Trivial Extension ends here. | ||||
|  | ||||
| ---- DOCUMENTATION ---- | ||||
|  | ||||
| Everything after the "---- DOCUMENTATION ----" line is documentation, so it should have the comment style. | ||||
|  | ||||
| However, tab-indented lines are sample Inform code within the documentation: | ||||
|  | ||||
| 	Horns are a kind of thing. Every cow has horns. | ||||
|  | ||||
| So we need to allow for that. | ||||
|   | ||||
| @@ -2,11 +2,61 @@ | ||||
|  | ||||
| Include Trivial Extension by Andrew Plotkin. | ||||
|  | ||||
| Volume 1 - overview | ||||
|  | ||||
| Chapter - setting the scene | ||||
|  | ||||
| The Kitchen is a room. | ||||
|  | ||||
| [This kitchen is modelled after the one in Zork, although it lacks the detail to establish this to the player.] | ||||
| [Comment: this kitchen is modelled after the one in Zork, although it lacks the detail to establish this to the player.] | ||||
|  | ||||
| Section - the kitchen table | ||||
|  | ||||
| The spicerack is a container in the Kitchen. | ||||
|  | ||||
| Table of Spices | ||||
| Name	Flavor | ||||
| "cinnamon"	5 | ||||
| "nutmeg"	4 | ||||
| "szechuan pepper"	8 | ||||
|  | ||||
| The description of the spicerack is "It's mostly empty." | ||||
|  | ||||
| Chapter - a character | ||||
|  | ||||
| A purple cow called Gelett is in the Kitchen. | ||||
|  | ||||
| [This comment spans multiple lines.. | ||||
|  | ||||
| ...and this line contains [nested square[] brackets]... | ||||
|  | ||||
| ...which is legal in Inform 7.] | ||||
|  | ||||
| Instead of examining Gelett: | ||||
| 	say "You'd rather see than be one." | ||||
|  | ||||
| Instead of examining Gelett: | ||||
| 	say "You'd rather see than be one." | ||||
|  | ||||
| Check smelling Gelett: | ||||
| 	say "This text contains several lines. | ||||
|  | ||||
| A blank line is displayed as a paragraph break, | ||||
| but a simple line break is not."; | ||||
| 	stop the action. | ||||
|  | ||||
| Section - cow catching | ||||
|  | ||||
| Gelett has a number called the mooness. | ||||
|  | ||||
| Instead of taking Gelett: | ||||
| 	increment the mooness of Gelett; | ||||
| 	if the mooness of Gelett is one: | ||||
| 		say "Gelett moos once."; | ||||
| 	else: | ||||
| 		say "Gelett moos [mooness of Gelett in words] times."; | ||||
|  | ||||
| Volume 2 - the turn cycle | ||||
|  | ||||
| Every turn: | ||||
| 	say "A turn passes[one of][or] placidly[or] idly[or] tediously[at random]." | ||||
|   | ||||
		Reference in New Issue
	
	Block a user