Debian Codegraph @

examples/prism-inform7.html

raw symbols SCIP
1 <h2>Comments</h2>
2 <pre><code>[This is a comment]
3 [This is a
4 multi-line comment]</code></pre>
5
6 <h2>Texts</h2>
7 <pre><code>"This is a string"
8 "This is a
9 multi-line string"</code></pre>
10
11 <h2>Numbers</h2>
12 <pre><code>42
13 3.14159
14 50kg
15 100m
16 one
17 three
18 twelve</code></pre>
19
20 <h2>Titles</h2>
21 <pre><code>Section 2 - Flamsteed's Balloon
22
23 Part SR1 - The Physical World Model
24
25 Table of Floors</code></pre>
26
27 <h2>Standard kinds, verbs and keywords</h2>
28 <pre><code>In the Treehouse is a container called the cardboard box.
29 The cardboard box is a closed container. The glass bottle is a transparent open container. The box is fixed in place and openable.
30
31 Check photographing:
32 if the noun is the camera, say "Sadly impossible." instead.</code></pre>
33
34 <h2>Text substitution</h2>
35 <pre><code>"[if the player is in Center Ring]A magician's booth stands in the corner, painted dark blue with glittering gold stars.[otherwise if the magician's booth is closed]A crack of light indicates the way back out to the center ring.[otherwise]The door stands open to the outside.[end if]".</code></pre>
36
37 <h2>Full example</h2>
38 <pre><code>"Lakeside Living"
39
40 A volume is a kind of value. 15.9 fl oz specifies a volume with parts ounces and tenths (optional, preamble optional).
41
42 A fluid container is a kind of container. A fluid container has a volume called a fluid capacity. A fluid container has a volume called current volume.
43
44 The fluid capacity of a fluid container is usually 12.0 fl oz. The current volume of a fluid container is usually 0.0 fl oz.
45
46 Liquid is a kind of value. The liquids are water, absinthe, and iced tea. A fluid container has a liquid.
47
48 Instead of examining a fluid container:
49 if the noun is empty,
50 say "You catch just a hint of [the liquid of the noun] at the bottom.";
51 otherwise
52 say "[The noun] contains [current volume of the noun in rough terms] of [liquid of the noun]."
53
54 To say (amount - a volume) in rough terms:
55 if the amount is less than 0.5 fl oz:
56 say "a swallow or two";
57 otherwise if tenths part of amount is greater than 3 and tenths part of amount is less than 7:
58 let estimate be ounces part of amount;
59 say "[estimate in words] or [estimate plus 1 in words] fluid ounces";
60 otherwise:
61 if tenths part of amount is greater than 6, increase amount by 1.0 fl oz;
62 say "about [ounces part of amount in words] fluid ounce[s]".
63
64 Before printing the name of a fluid container (called the target) while not drinking or pouring:
65 if the target is empty:
66 say "empty ";
67 otherwise:
68 do nothing.
69
70 After printing the name of a fluid container (called the target) while not examining or pouring:
71 unless the target is empty:
72 say " of [liquid of the target]";
73 omit contents in listing.
74
75 Instead of inserting something into a fluid container:
76 say "[The second noun] has too narrow a mouth to accept anything but liquids."
77
78 Definition: a fluid container is empty if the current volume of it is 0.0 fl oz. Definition: a fluid container is full if the current volume of it is the fluid capacity of it.
79
80 Understand "drink from [fluid container]" as drinking.
81
82 Instead of drinking a fluid container:
83 if the noun is empty:
84 say "There is no more [liquid of the noun] within." instead;
85 otherwise:
86 decrease the current volume of the noun by 0.2 fl oz;
87 if the current volume of the noun is less than 0.0 fl oz, now the current volume of the noun is 0.0 fl oz;
88 say "You take a sip of [the liquid of the noun][if the noun is empty], leaving [the noun] empty[end if]."
89
90 Part 2 - Filling
91
92 Understand the command "fill" as something new.
93
94 Understand "fill [fluid container] with/from [full liquid source]" as filling it with. Understand "fill [fluid container] with/from [fluid container]" as filling it with.
95
96 Understand "fill [something] with/from [something]" as filling it with.
97
98 Filling it with is an action applying to two things. Carry out filling it with: try pouring the second noun into the noun instead.
99
100 Understand "pour [fluid container] in/into/on/onto [fluid container]" as pouring it into. Understand "empty [fluid container] into [fluid container]" as pouring it into.
101
102 Understand "pour [something] in/into/on/onto [something]" as pouring it into. Understand "empty [something] into [something]" as pouring it into.
103
104 Pouring it into is an action applying to two things.
105
106 Check pouring it into:
107 if the noun is not a fluid container, say "You can't pour [the noun]." instead;
108 if the second noun is not a fluid container, say "You can't pour liquids into [the second noun]." instead;
109 if the noun is the second noun, say "You can hardly pour [the noun] into itself." instead;
110 if the liquid of the noun is not the liquid of the second noun:
111 if the second noun is empty, now the liquid of the second noun is the liquid of the noun;
112 otherwise say "Mixing [the liquid of the noun] with [the liquid of the second noun] would give unsavory results." instead;
113 if the noun is empty, say "No more [liquid of the noun] remains in [the noun]." instead;
114 if the second noun is full, say "[The second noun] cannot contain any more than it already holds." instead.
115
116 Carry out pouring it into:
117 let available capacity be the fluid capacity of the second noun minus the current volume of the second noun;
118 if the available capacity is greater than the current volume of the noun, now the available capacity is the current volume of the noun;
119 increase the current volume of the second noun by available capacity;
120 decrease the current volume of the noun by available capacity.
121
122 Report pouring it into:
123 say "[if the noun is empty][The noun] is now empty;[otherwise][The noun] now contains [current volume of the noun in rough terms] of [liquid of the noun]; [end if]";
124 say "[the second noun] contains [current volume of the second noun in rough terms] of [liquid of the second noun][if the second noun is full], and is now full[end if]."
125
126 Understand the liquid property as describing a fluid container. Understand "of" as a fluid container.
127
128 A liquid source is a kind of fluid container. A liquid source has a liquid. A liquid source is usually scenery. The fluid capacity of a liquid source is usually 3276.7 fl oz. The current volume of a liquid source is usually 3276.7 fl oz. Instead of examining a liquid source: say "[The noun] is full of [liquid of the noun]."
129
130 Carry out pouring a liquid source into something: now the current volume of the noun is 3276.7 fl oz.
131
132 After pouring a liquid source into a fluid container:
133 say "You fill [the second noun] up with [liquid of the noun] from [the noun]."
134
135 Instead of pouring a fluid container into a liquid source:
136 if the noun is empty, say "[The noun] is already empty." instead;
137 now the current volume of the noun is 0.0 fl oz;
138 say "You dump out [the noun] into [the second noun]."
139
140 Swimming is an action applying to nothing. Understand "swim" or "dive" as swimming.
141
142 Instead of swimming in the presence of a liquid source:
143 say "You don't feel like a dip just now."
144
145 Before inserting something into a liquid source: say "[The noun] would get lost and never be seen again." instead.
146
147 Part 3 - Scenario
148
149 The Lakeside is a room. The Lakeside swing is an enterable supporter in the Lakeside. "Here you are by the lake, enjoying a summery view."
150
151 The glass is a fluid container carried by the player. The liquid of the glass is absinthe. The current volume of the glass is 0.8 fl oz.
152
153 The pitcher is a fluid container in the Lakeside. The fluid capacity of the pitcher is 32.0 fl oz. The current volume of the pitcher is 20.0 fl oz. The liquid of the pitcher is absinthe.
154
155 The lake is a liquid source. It is in the Lakeside.
156
157 The player wears a bathing outfit. The description of the bathing outfit is "Stylishly striped in blue and white, and daringly cut to reveal almost all of your calves, and quite a bit of upper arm, as well. You had a moral struggle, purchasing it; but mercifully the lakeshore is sufficiently secluded that no one can see you in this immodest apparel."
158
159 Instead of taking off the outfit: say "What odd ideas come into your head sometimes!"
160
161 Test me with "fill glass / empty absinthe into lake / fill glass / swim / drink lake / drink / x water / x lake". </code></pre>