1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-05-19 17:39:23 +03:00

Numerous further BIP cases

This commit is contained in:
Graham Nelson 2020-01-21 01:17:11 +00:00
parent bd09f85ea8
commit 6dcd0b4f68
69 changed files with 1272 additions and 383 deletions

2
.gitignore vendored
View file

@ -6,6 +6,8 @@ gameinfo.dbg
makefile
*.glkdata
resources/Changes/Output/
resources/Changes/Output/META-INF/
resources/Changes/Output/OEBPS/

View file

@ -391,16 +391,23 @@ To say (L - a list of objects) with indefinite articles
The "now" phrase can do an extraordinary range of things, and is more or
less a genie granting one wish.
The "whether or not" phrase exists only to convert a condition to a value,
and is needed because I7 does not silently cast from one to the other in
the way that C would.
See test case |BIP-Now|.
=
Chapter 2
Chapter 2 - Conditions and Variables
Section 1 - Making Conditions True
Section 1 - Conditions
To now (cn - condition)
(documented at ph_now):
(- {cn} -).
To decide what truth state is whether or not (C - condition)
(documented at ph_whether):
(- ({C}) -).
@ Assignment is probably the most difficult thing the type-checker has to
cope with, since "let" has to work when applied to both unknown names (it
@ -483,7 +490,6 @@ To decrement (S - storage)
{-copy:S:-};
-).
@h Arithmetic.
There are nine arithmetic operations, internally numbered 0 upwards, and
given verbal forms below. These are handled unusually in the type-checker
@ -743,17 +749,28 @@ To decide no
(documented at ph_no):
(- rfalse; -) - in to decide if only.
To stop (documented at ph_stop):
(- rtrue; -) - in to only.
To decide on (something - value)
(documented at ph_decideon):
(- return {-return-value:something}; -).
@h Control phrases.
While "unless" is supposed to be exactly like "if" but with the reversed
@ While "unless" is supposed to be exactly like "if" but with the reversed
sense of the condition, that isn't quite true. For example, there is no
"unless ... then ...": logical it might be, English it is not.
The switch form of "if" is subtly different, and here again "unless" is
not allowed in its place.
As with some other control structures, the definitions here are somewhat
partial, and made up for by direct code in the compiler. (There's a limit to
how much a general syntax for phrases can encode control phrases.)
See test case |BIP-If|.
=
Section SR5/3/1 - Control phrases - If and unless
Section 2 - If and Unless
To if (c - condition) begin -- end conditional
(documented at ph_if):
@ -761,26 +778,30 @@ To if (c - condition) begin -- end conditional
To unless (c - condition) begin -- end conditional
(documented at ph_unless):
(- (~~{c}) -).
@ The switch form of "if" is subtly different, and here again "unless" is
not allowed in its place.
The begin and end markers here are in a sense bogus, in that the end
user isn't supposed to type them: they are inserted automatically in
the sentence subtree maker, which converts indentation into block
structure.
=
To if (V - value) is begin -- end conditional
(documented at ph_switch):
(- -).
@ "Do nothing" is a curious feature for a high-level programming language (C,
for example, does not have a NOP function); it entered Inform in the earliest
days, when it was useful mainly when natural language syntax had painted users
into a corner. (In the examples, it used to be used when conditions were
awkward to negate -- if condition, do nothing, otherwise blah blah blah -- but
the creation of "unless" made it possible to remove most of the "do
nothing"s.) It is now hardly ever useful.
=
To do nothing (documented at ph_nothing):
(- ; -).
@ After all that, the while loop is simplicity itself. Perhaps the presence
of "unless" for "if" argues for a similarly negated form, "until" for
"while", but users haven't yet petitioned for this.
See test case |BIP-Loops|.
=
Section SR5/3/2 - Control phrases - While
Section 3 - While and Repeat
To while (c - condition) begin -- end loop
(documented at ph_while):
@ -792,8 +813,6 @@ then has a different kind of value accordingly). First, the equivalents of
BASIC's |for| loop and of Inform 6's |objectloop|, respectively:
=
Section SR5/3/3 - Control phrases - Repeat
To repeat with (loopvar - nonexisting K variable)
running from (v - arithmetic value of kind K) to (w - K) begin -- end loop
(documented at ph_repeat):
@ -859,8 +878,10 @@ To repeat through (T - table name) in reverse (TC - table column) order begin --
@ The equivalent of |break| or |continue| in C or I6, or of |last| or |next|
in Perl. Here "in loop" means "in any of the forms of while or repeat".
See test case |BIP-Break|.
=
Section SR5/3/6 - Control phrases - Changing the flow of loops
Section 4 - Loop Flow
To break -- in loop
(documented at ph_break):
@ -869,9 +890,6 @@ To next -- in loop
(documented at ph_next):
(- continue; -).
@h Values.
Some of the things we can do with enumerations, others being listed under
randomness below.
@ -929,6 +947,20 @@ To seed the random-number generator with (N - number)
(documented at ph_seed):
(- VM_Seed_RNG({N}); -).
@ A novel feature of Inform is that there is a default value of any kind: fpr
example, it is 0 for a number, or the empty text for text. When Inform compiles
a value of a given kind but isn't told what value to compile, it always
chooses the default, which is why the following definition works.
See test case |BIP-DefaultValues|.
=
Section 3 - Default Values
To decide what K is the default value of (V - name of kind of value of kind K)
(documented at ph_defaultvalue):
(- {-new:K} -).
@h Text.
Inform programs swim in a sea of texts, and most of the ways to make text
involve substitutions; so phrases to manipulate text are nice to have, but
@ -1445,39 +1477,198 @@ To decide which L is (name of kind of value L) that/which/whom (X - K)
(documented at ph_rightlookup):
(- RelationTest({-by-reference:R}, RELS_LOOKUP_ANY, {X}, RLANY_GET_Y) -). [2]
@ "Do nothing" is useful mainly when other syntax has backed us into
something clumsy, but it can't be dispensed with. (In the examples, it used
to be used when conditions were awkward to negate -- if condition, do nothing,
otherwise blah blah blah -- but the creation of "unless" made it possible
to remove most of the "do nothing"s.)
@h Functional Programming.
Here we have the ability to use the name of a function as a value, and to
apply such a function.
See test case |BIP-Apply|.
=
Section SR5/3/8 - Control phrases - Stop or go
Chapter 7 - Functional Programming
To do nothing (documented at ph_nothing):
(- ; -).
To stop (documented at ph_stop):
(- rtrue; -) - in to only.
Section 1 - Applying Functions
@
To decide whether (val - K) matches (desc - description of values of kind K)
(documented at ph_valuematch):
(- {-primitive-definition:description-application} -).
See test case |Showme|.
To decide what K is (function - phrase nothing -> value of kind K) applied
(documented at ph_applied0):
(- {-primitive-definition:function-application} -).
To decide what L is (function - phrase value of kind K -> value of kind L)
applied to (input - K)
(documented at ph_applied1):
(- {-primitive-definition:function-application} -).
To decide what M is (function - phrase (value of kind K, value of kind L) -> value of kind M)
applied to (input - K) and (second input - L)
(documented at ph_applied2):
(- {-primitive-definition:function-application} -).
To decide what N is (function - phrase (value of kind K, value of kind L, value of kind M) -> value of kind N)
applied to (input - K) and (second input - L) and (third input - M)
(documented at ph_applied3):
(- {-primitive-definition:function-application} -).
To apply (function - phrase nothing -> nothing)
(documented at ph_apply0):
(- {-primitive-definition:function-application}; -).
To apply (function - phrase value of kind K -> nothing)
to (input - K)
(documented at ph_apply1):
(- {-primitive-definition:function-application}; -).
To apply (function - phrase (value of kind K, value of kind L) -> nothing)
to (input - K) and (second input - L)
(documented at ph_apply2):
(- {-primitive-definition:function-application}; -).
To apply (function - phrase (value of kind K, value of kind L, value of kind M) -> nothing)
to (input - K) and (second input - L) and (third input - M)
(documented at ph_apply3):
(- {-primitive-definition:function-application}; -).
@ The standard map, reduce and filter operations found in most functional
programming languages also have Inform analogues.
See test case |BIP-Map|.
=
To decide what K is the default value of (V - name of kind of value of kind K)
(documented at ph_defaultvalue):
(- {-new:K} -).
Section 2 - Working with Lists
@ The following exists only to convert a condition to a value, and is
needed because I7 does not silently cast from one to the other in the way
that C would.
To decide what list of L is (function - phrase K -> value of kind L) applied to (original list - list of values of kind K)
(documented at ph_appliedlist):
let the result be a list of Ls;
repeat with item running through the original list:
let the mapped item be the function applied to the item;
add the mapped item to the result;
decide on the result.
To decide what K is the (function - phrase (K, K) -> K) reduction of (original list - list of values of kind K)
(documented at ph_reduction):
let the total be a K;
let the count be 0;
repeat with item running through the original list:
increase the count by 1;
if the count is 1, now the total is the item;
otherwise now the total is the function applied to the total and the item;
decide on the total.
To decide what list of K is the filter to (criterion - description of Ks) of
(full list - list of values of kind K)
(documented at ph_filter):
let the filtered list be a list of K;
repeat with item running through the full list:
if the item matches the criterion:
add the item to the filtered list;
decide on the filtered list.
@h Rulebooks and Activities.
Firing off activities:
See test case |BIP-Activities|.
=
Section SR5/2/6 - Values - Truth states
Section 1 - Carrying out Activities
To decide what truth state is whether or not (C - condition)
(documented at ph_whether):
(- ({C}) -).
To carry out the (A - activity on nothing) activity
(documented at ph_carryout):
(- CarryOutActivity({A}); -).
To carry out the (A - activity on value of kind K) activity with (val - K)
(documented at ph_carryoutwith):
(- CarryOutActivity({A}, {val}); -).
To continue the activity
(documented at ph_continueactivity):
(- rfalse; -) - in to only.
@ Advanced activity phrases: for setting up one's own activities structured
around I7 source text. People tend not to use this much, and perhaps that's
a good thing, but it does open up possibilities, and it's good for
retro-fitting onto extensions to make them more customisable.
=
Section 2 - Advanced Activities
To begin the (A - activity on nothing) activity
(documented at ph_beginactivity):
(- BeginActivity({A}); -).
To begin the (A - activity on value of kind K) activity with (val - K)
(documented at ph_beginactivitywith):
(- BeginActivity({A}, {val}); -).
To decide whether handling (A - activity) activity
(documented at ph_handlingactivity):
(- (~~(ForActivity({A}))) -).
To decide whether handling (A - activity on value of kind K) activity with (val - K)
(documented at ph_handlingactivitywith):
(- (~~(ForActivity({A}, {val}))) -).
To end the (A - activity on nothing) activity
(documented at ph_endactivity):
(- EndActivity({A}); -).
To end the (A - activity on value of kind K) activity with (val - K)
(documented at ph_endactivitywith):
(- EndActivity({A}, {val}); -).
To abandon the (A - activity on nothing) activity
(documented at ph_abandonactivity):
(- AbandonActivity({A}); -).
To abandon the (A - activity on value of kind K) activity with (val - K)
(documented at ph_abandonactivitywith):
(- AbandonActivity({A}, {val}); -).
@h External Files.
Inform has a quirky level of support for file-handling, which comes out what
the Glulx virtual machine will support.
See test case |BIP-Files-G|, which has no Z-machine counterpart.
=
Chapter 9 - External Files (not for Z-machine)
Section 1 - Files of Text
To write (T - text) to (FN - external file)
(documented at ph_writetext):
(- FileIO_PutContents({FN}, {T}, false); -).
To append (T - text) to (FN - external file)
(documented at ph_appendtext):
(- FileIO_PutContents({FN}, {T}, true); -).
To say text of (FN - external file)
(documented at ph_saytext):
(- FileIO_PrintContents({FN}); say__p = 1; -).
@ See test case |BIP-FilesOfTables-G|, which has no Z-machine counterpart.
=
Section 2 - Files of Data
To read (filename - external file) into (T - table name)
(documented at ph_readtable):
(- FileIO_GetTable({filename}, {T}); -).
To write (filename - external file) from (T - table name)
(documented at ph_writetable):
(- FileIO_PutTable({filename}, {T}); -).
@ These are hardly used phrases which are difficult to test convincingly
in our framework, since they defend against independent Inform programs
simultaneously trying to access the same file.
=
Section 3 - File Handling
To decide if (filename - external file) exists
(documented at ph_fileexists):
(- (FileIO_Exists({filename}, false)) -).
To decide if ready to read (filename - external file)
(documented at ph_fileready):
(- (FileIO_Ready({filename}, false)) -).
To mark (filename - external file) as ready to read
(documented at ph_markfileready):
(- FileIO_MarkReady({filename}, true); -).
To mark (filename - external file) as not ready to read
(documented at ph_markfilenotready):
(- FileIO_MarkReady({filename}, false); -).
@ And so, at last...
@ -1493,6 +1684,6 @@ extension.
=
---- DOCUMENTATION ----
Unlike other extensions, the Standard Rules are compulsorily included
with every project. They define the phrases, kinds and relations which
are basic to Inform, and which are described throughout the documentation.
Unlike other extensions, Basic Inform is compulsorily included with every
project. It defines the phrases, kinds and relations which are basic to
Inform, and which are described throughout the documentation.

View file

@ -229,6 +229,9 @@ The enable Glulx acceleration rule is listed first in for starting the virtual m
The enable Glulx acceleration rule translates into I6 as "ENABLE_GLULX_ACCEL_R".
The parameter-object is an object that varies.
The parameter-object variable translates into I6 as "parameter_value".
Printing the name of something (documented at act_pn) is an activity. [0]
The standard name printing rule is listed last in the for printing the name rulebook.
@ -251,3 +254,13 @@ The verb to be less than means the numerically-less-than relation.
The verb to be at least means the numerically-greater-than-or-equal-to relation.
The verb to be at most means the numerically-less-than-or-equal-to relation.
@h Adjectival definitions.
=
Definition: a number is even rather than odd if the remainder after dividing it by 2 is 0.
Definition: a number is positive if it is greater than zero.
Definition: a number is negative if it is less than zero.
Definition: a text is empty rather than non-empty if I6 routine
"TEXT_TY_Empty" says so (it contains no characters).

View file

@ -127,6 +127,9 @@ The enable Glulx acceleration rule is listed first in for starting the virtual m
The enable Glulx acceleration rule translates into I6 as "ENABLE_GLULX_ACCEL_R".
The parameter-object is an object that varies.
The parameter-object variable translates into I6 as "parameter_value".
Printing the name of something (documented at act_pn) is an activity. [0]
The standard name printing rule is listed last in the for printing the name rulebook.
@ -142,6 +145,13 @@ The verb to be less than means the numerically-less-than relation.
The verb to be at least means the numerically-greater-than-or-equal-to relation.
The verb to be at most means the numerically-less-than-or-equal-to relation.
Definition: a number is even rather than odd if the remainder after dividing it by 2 is 0.
Definition: a number is positive if it is greater than zero.
Definition: a number is negative if it is less than zero.
Definition: a text is empty rather than non-empty if I6 routine
"TEXT_TY_Empty" says so (it contains no characters).
Part Two - Phrasebook
@ -326,13 +336,16 @@ To say (L - a list of objects) with indefinite articles
(documented at phs_listindef):
(- LIST_OF_TY_Say({-by-reference:L}, 3); -).
Chapter 2
Chapter 2 - Conditions and Variables
Section 1 - Making Conditions True
Section 1 - Conditions
To now (cn - condition)
(documented at ph_now):
(- {cn} -).
To decide what truth state is whether or not (C - condition)
(documented at ph_whether):
(- ({C}) -).
Section 2 - Assigning Temporary Variables
@ -393,7 +406,6 @@ To decrement (S - storage)
{-copy:S:-};
-).
Chapter 2 - Arithmetic
Section 1 - Arithmetic Operations
@ -595,11 +607,14 @@ To decide no
(documented at ph_no):
(- rfalse; -) - in to decide if only.
To stop (documented at ph_stop):
(- rtrue; -) - in to only.
To decide on (something - value)
(documented at ph_decideon):
(- return {-return-value:something}; -).
Section SR5/3/1 - Control phrases - If and unless
Section 2 - If and Unless
To if (c - condition) begin -- end conditional
(documented at ph_if):
@ -607,19 +622,19 @@ To if (c - condition) begin -- end conditional
To unless (c - condition) begin -- end conditional
(documented at ph_unless):
(- (~~{c}) -).
To if (V - value) is begin -- end conditional
(documented at ph_switch):
(- -).
Section SR5/3/2 - Control phrases - While
To do nothing (documented at ph_nothing):
(- ; -).
Section 3 - While and Repeat
To while (c - condition) begin -- end loop
(documented at ph_while):
(- while {c} -).
Section SR5/3/3 - Control phrases - Repeat
To repeat with (loopvar - nonexisting K variable)
running from (v - arithmetic value of kind K) to (w - K) begin -- end loop
(documented at ph_repeat):
@ -676,7 +691,7 @@ To repeat through (T - table name) in reverse (TC - table column) order begin --
@pull {-my:ct_1}; @pull {-my:ct_0};
-).
Section SR5/3/6 - Control phrases - Changing the flow of loops
Section 4 - Loop Flow
To break -- in loop
(documented at ph_break):
@ -685,9 +700,6 @@ To next -- in loop
(documented at ph_next):
(- continue; -).
Chapter 4 - Values
Section 1 - Enumerations
@ -732,6 +744,12 @@ To seed the random-number generator with (N - number)
(documented at ph_seed):
(- VM_Seed_RNG({N}); -).
Section 3 - Default Values
To decide what K is the default value of (V - name of kind of value of kind K)
(documented at ph_defaultvalue):
(- {-new:K} -).
Chapter 5 - Text
Section 1 - Breaking down text
@ -916,9 +934,6 @@ To say negate (V - verb) in (T - grammatical tense) from (P - narrative viewpoin
To decide which relation of objects is meaning of (V - a verb): (- {V}(CV_MEANING) -).
Chapter 6 - Data Structures
Section 1 - Tables
@ -1153,28 +1168,163 @@ To decide which L is (name of kind of value L) that/which/whom (X - K)
(documented at ph_rightlookup):
(- RelationTest({-by-reference:R}, RELS_LOOKUP_ANY, {X}, RLANY_GET_Y) -). [2]
Section SR5/3/8 - Control phrases - Stop or go
Chapter 7 - Functional Programming
To do nothing (documented at ph_nothing):
(- ; -).
To stop (documented at ph_stop):
(- rtrue; -) - in to only.
Section 1 - Applying Functions
To decide what K is the default value of (V - name of kind of value of kind K)
(documented at ph_defaultvalue):
(- {-new:K} -).
To decide whether (val - K) matches (desc - description of values of kind K)
(documented at ph_valuematch):
(- {-primitive-definition:description-application} -).
Section SR5/2/6 - Values - Truth states
To decide what K is (function - phrase nothing -> value of kind K) applied
(documented at ph_applied0):
(- {-primitive-definition:function-application} -).
To decide what truth state is whether or not (C - condition)
(documented at ph_whether):
(- ({C}) -).
To decide what L is (function - phrase value of kind K -> value of kind L)
applied to (input - K)
(documented at ph_applied1):
(- {-primitive-definition:function-application} -).
To decide what M is (function - phrase (value of kind K, value of kind L) -> value of kind M)
applied to (input - K) and (second input - L)
(documented at ph_applied2):
(- {-primitive-definition:function-application} -).
To decide what N is (function - phrase (value of kind K, value of kind L, value of kind M) -> value of kind N)
applied to (input - K) and (second input - L) and (third input - M)
(documented at ph_applied3):
(- {-primitive-definition:function-application} -).
To apply (function - phrase nothing -> nothing)
(documented at ph_apply0):
(- {-primitive-definition:function-application}; -).
To apply (function - phrase value of kind K -> nothing)
to (input - K)
(documented at ph_apply1):
(- {-primitive-definition:function-application}; -).
To apply (function - phrase (value of kind K, value of kind L) -> nothing)
to (input - K) and (second input - L)
(documented at ph_apply2):
(- {-primitive-definition:function-application}; -).
To apply (function - phrase (value of kind K, value of kind L, value of kind M) -> nothing)
to (input - K) and (second input - L) and (third input - M)
(documented at ph_apply3):
(- {-primitive-definition:function-application}; -).
Section 2 - Working with Lists
To decide what list of L is (function - phrase K -> value of kind L) applied to (original list - list of values of kind K)
(documented at ph_appliedlist):
let the result be a list of Ls;
repeat with item running through the original list:
let the mapped item be the function applied to the item;
add the mapped item to the result;
decide on the result.
To decide what K is the (function - phrase (K, K) -> K) reduction of (original list - list of values of kind K)
(documented at ph_reduction):
let the total be a K;
let the count be 0;
repeat with item running through the original list:
increase the count by 1;
if the count is 1, now the total is the item;
otherwise now the total is the function applied to the total and the item;
decide on the total.
To decide what list of K is the filter to (criterion - description of Ks) of
(full list - list of values of kind K)
(documented at ph_filter):
let the filtered list be a list of K;
repeat with item running through the full list:
if the item matches the criterion:
add the item to the filtered list;
decide on the filtered list.
Section 1 - Carrying out Activities
To carry out the (A - activity on nothing) activity
(documented at ph_carryout):
(- CarryOutActivity({A}); -).
To carry out the (A - activity on value of kind K) activity with (val - K)
(documented at ph_carryoutwith):
(- CarryOutActivity({A}, {val}); -).
To continue the activity
(documented at ph_continueactivity):
(- rfalse; -) - in to only.
Section 2 - Advanced Activities
To begin the (A - activity on nothing) activity
(documented at ph_beginactivity):
(- BeginActivity({A}); -).
To begin the (A - activity on value of kind K) activity with (val - K)
(documented at ph_beginactivitywith):
(- BeginActivity({A}, {val}); -).
To decide whether handling (A - activity) activity
(documented at ph_handlingactivity):
(- (~~(ForActivity({A}))) -).
To decide whether handling (A - activity on value of kind K) activity with (val - K)
(documented at ph_handlingactivitywith):
(- (~~(ForActivity({A}, {val}))) -).
To end the (A - activity on nothing) activity
(documented at ph_endactivity):
(- EndActivity({A}); -).
To end the (A - activity on value of kind K) activity with (val - K)
(documented at ph_endactivitywith):
(- EndActivity({A}, {val}); -).
To abandon the (A - activity on nothing) activity
(documented at ph_abandonactivity):
(- AbandonActivity({A}); -).
To abandon the (A - activity on value of kind K) activity with (val - K)
(documented at ph_abandonactivitywith):
(- AbandonActivity({A}, {val}); -).
Chapter 9 - External Files (not for Z-machine)
Section 1 - Files of Text
To write (T - text) to (FN - external file)
(documented at ph_writetext):
(- FileIO_PutContents({FN}, {T}, false); -).
To append (T - text) to (FN - external file)
(documented at ph_appendtext):
(- FileIO_PutContents({FN}, {T}, true); -).
To say text of (FN - external file)
(documented at ph_saytext):
(- FileIO_PrintContents({FN}); say__p = 1; -).
Section 2 - Files of Data
To read (filename - external file) into (T - table name)
(documented at ph_readtable):
(- FileIO_GetTable({filename}, {T}); -).
To write (filename - external file) from (T - table name)
(documented at ph_writetable):
(- FileIO_PutTable({filename}, {T}); -).
Section 3 - File Handling
To decide if (filename - external file) exists
(documented at ph_fileexists):
(- (FileIO_Exists({filename}, false)) -).
To decide if ready to read (filename - external file)
(documented at ph_fileready):
(- (FileIO_Ready({filename}, false)) -).
To mark (filename - external file) as ready to read
(documented at ph_markfileready):
(- FileIO_MarkReady({filename}, true); -).
To mark (filename - external file) as not ready to read
(documented at ph_markfilenotready):
(- FileIO_MarkReady({filename}, false); -).
Basic Inform ends here.
---- DOCUMENTATION ----
Unlike other extensions, the Standard Rules are compulsorily included
with every project. They define the phrases, kinds and relations which
are basic to Inform, and which are described throughout the documentation.
Unlike other extensions, Basic Inform is compulsorily included with every
project. It defines the phrases, kinds and relations which are basic to
Inform, and which are described throughout the documentation.

View file

@ -40,6 +40,7 @@ Global clr_bgstatus = 1; ! background colour of statusline
Global clr_on; ! has colour been enabled by the player?
Global statuswin_current; ! if writing to top window
Global suppress_text_substitution = false;
Global deadflag = 0;
! [14]
Global statuswin_cursize = 0;

View file

@ -123,7 +123,6 @@ Global sline1; Global sline2;
Global undo_flag;
! [4]
Global deadflag = 0;
Global story_complete = 0;
Global resurrect_please = false;

View file

@ -0,0 +1,17 @@
Commenting on something is an activity on numbers.
Rule for commenting on an even number:
say "That's even.";
continue the activity.
Rule for commenting on an odd number:
say "That's odd.".
Rule for commenting on a number (called N):
say "It would seem to be [N]."
To begin:
carry out the commenting on activity with 4;
carry out the commenting on activity with 5;
carry out the commenting on activity with 6;
carry out the commenting on activity with 7;

View file

@ -0,0 +1,17 @@
Commenting on something is an activity on numbers.
Rule for commenting on an even number:
say "That's even.";
continue the activity.
Rule for commenting on an odd number:
say "That's odd.".
Rule for commenting on a number (called N):
say "It would seem to be [N]."
To begin:
carry out the commenting on activity with 4;
carry out the commenting on activity with 5;
carry out the commenting on activity with 6;
carry out the commenting on activity with 7;

View file

@ -0,0 +1,12 @@
To decide what number is double (N - a number) (this is doubling):
decide on N plus N.
To decide which number is the length of (T - an text) (this is length extraction):
decide on the number of characters in T.
To begin:
showme doubling;
showme doubling applied to 2;
showme length extraction;
showme length extraction applied to "Hello world!";
showme the length of "Hello world!";

View file

@ -0,0 +1,12 @@
To decide what number is double (N - a number) (this is doubling):
decide on N plus N.
To decide which number is the length of (T - an text) (this is length extraction):
decide on the number of characters in T.
To begin:
showme doubling;
showme doubling applied to 2;
showme length extraction;
showme length extraction applied to "Hello world!";
showme the length of "Hello world!";

View file

@ -0,0 +1,15 @@
To begin:
repeat with M running from 1 to 10:
if M is 5:
next;
showme M;
if M is 7:
break;
let K be 0;
while K is less than 20:
increment K;
if K is 5:
next;
showme K;
if K is 7:
break;

View file

@ -0,0 +1,15 @@
To begin:
repeat with M running from 1 to 10:
if M is 5:
next;
showme M;
if M is 7:
break;
let K be 0;
while K is less than 20:
increment K;
if K is 5:
next;
showme K;
if K is 7:
break;

View file

@ -7,6 +7,11 @@ To decide if (N - number) pleases us:
To decide if (N - number) displeases us:
decide no.
To demonstrate stop:
say "I begin.";
stop;
say "I do not continue.";
A fruit is a kind of object. An apple, a pear and an orange are fruits.
Definition: a fruit is tasty:
@ -17,3 +22,4 @@ To begin:
showme whether or not 31 pleases us;
showme whether or not -417 displeases us;
showme whether or not a fruit is tasty;
demonstrate stop;

View file

@ -7,6 +7,11 @@ To decide if (N - number) pleases us:
To decide if (N - number) displeases us:
decide no.
To demonstrate stop:
say "I begin.";
stop;
say "I do not continue.";
A fruit is a kind of object. An apple, a pear and an orange are fruits.
Definition: a fruit is tasty:
@ -17,3 +22,4 @@ To begin:
showme whether or not 31 pleases us;
showme whether or not -417 displeases us;
showme whether or not a fruit is tasty;
demonstrate stop;

View file

@ -0,0 +1,15 @@
The tally is a number that varies.
A fruit is a kind of object. An apple, a pear and a persimmon are fruits.
Colour is a kind of value. The colours are red, orange, yellow, green, blue, indigo, violet.
Distance is a kind of value. 10km specifies a distance.
To begin:
showme the default value of number;
showme the default value of colour;
showme the default value of fruit;
showme the default value of truth state;
showme the default value of text;
showme the default value of distance;

View file

@ -0,0 +1,15 @@
The tally is a number that varies.
A fruit is a kind of object. An apple, a pear and a persimmon are fruits.
Colour is a kind of value. The colours are red, orange, yellow, green, blue, indigo, violet.
Distance is a kind of value. 10km specifies a distance.
To begin:
showme the default value of number;
showme the default value of colour;
showme the default value of fruit;
showme the default value of truth state;
showme the default value of text;
showme the default value of distance;

View file

@ -0,0 +1,13 @@
A jotter is a kind of value. A jotter has an external file called the text file.
A jotter has a text called the heading.
The notebook is a jotter. The file of Observations is called "notebook".
The text file of the notebook is the file of Observations.
The heading of the notebook is "Observations in the Pottingham Green Case".
To begin:
write "[heading of the notebook][paragraph break]" to the text file of the notebook;
append "Here's a comment.[line break]" to the text file of the notebook;
append "Here's a secomd comment.[line break]" to the text file of the notebook;
say "You read back: [paragraph break][text of the text file of the notebook]".

View file

@ -0,0 +1,20 @@
Table of Selected Numbers
numeric alphabetic
4 "four"
3 "three"
154 "one hundred and fifty-four"
27 "twenty-seven"
9 "nine"
with 4 blank rows
Table of Reselected Numbers
numeric alphabetic
with 9 blank rows
The file of Selections is called "notebook".
To begin:
showme the contents of the Table of Selected Numbers;
write the file of Selections from the Table of Selected Numbers;
read the file of Selections into the Table of Reselected Numbers;
showme the contents of the Table of Reselected Numbers;

View file

@ -0,0 +1,25 @@
To check (V - a number):
if V is:
-- 1:
say "One.";
-- 2:
say "Two.";
-- otherwise:
say "Something larger."
To begin:
if 1 is 1:
say "Yes, 1 is 1.";
otherwise:
say "No, 1 is not 1.";
unless 1 is 1:
say "No, 1 is not 1.";
otherwise:
say "Yes, 1 is 1.";
if 1 is 1:
say "Yes, 1 is 1.";
else:
say "No, 1 is not 1.";
check 1;
check 2;
check 3;

View file

@ -0,0 +1,25 @@
To check (V - a number):
if V is:
-- 1:
say "One.";
-- 2:
say "Two.";
-- otherwise:
say "Something larger."
To begin:
if 1 is 1:
say "Yes, 1 is 1.";
otherwise:
say "No, 1 is not 1.";
unless 1 is 1:
say "No, 1 is not 1.";
otherwise:
say "Yes, 1 is 1.";
if 1 is 1:
say "Yes, 1 is 1.";
else:
say "No, 1 is not 1.";
check 1;
check 2;
check 3;

View file

@ -0,0 +1,37 @@
Colour is a kind of value. The colours are red, orange, yellow, green, blue, indigo, violet.
Table of Neptune's Moons
moon surface (text)
"Nereid" "utterly unknown"
"Triton" "cryovolcanic ridges"
"Proteus" "highly irregular and sooty"
-- --
To begin:
let N be 31;
while N is not 1:
showme N;
if N is even:
now N is N divided by 2;
otherwise:
now N is N times 3 plus 1;
repeat with M running from 1 to 5:
showme M;
repeat with C running from orange to indigo:
showme C;
repeat with C2 running through colours:
showme C2;
repeat with K running through { 2, 3, 5, 7, 11, 13 }:
showme K;
say "First run.";
repeat through the Table of Neptune's Moons:
say "[moon entry] has a surface best described as [surface entry].";
say "Second run.";
repeat through the Table of Neptune's Moons in reverse order:
say "[moon entry] has a surface best described as [surface entry].";
say "Third run.";
repeat through the Table of Neptune's Moons in surface order:
say "[moon entry] has a surface best described as [surface entry].";
say "Fourth run.";
repeat through the Table of Neptune's Moons in reverse surface order:
say "[moon entry] has a surface best described as [surface entry].";

View file

@ -0,0 +1,37 @@
Colour is a kind of value. The colours are red, orange, yellow, green, blue, indigo, violet.
Table of Neptune's Moons
moon surface (text)
"Nereid" "utterly unknown"
"Triton" "cryovolcanic ridges"
"Proteus" "highly irregular and sooty"
-- --
To begin:
let N be 31;
while N is not 1:
showme N;
if N is even:
now N is N divided by 2;
otherwise:
now N is N times 3 plus 1;
repeat with M running from 1 to 5:
showme M;
repeat with C running from orange to indigo:
showme C;
repeat with C2 running through colours:
showme C2;
repeat with K running through { 2, 3, 5, 7, 11, 13 }:
showme K;
say "First run.";
repeat through the Table of Neptune's Moons:
say "[moon entry] has a surface best described as [surface entry].";
say "Second run.";
repeat through the Table of Neptune's Moons in reverse order:
say "[moon entry] has a surface best described as [surface entry].";
say "Third run.";
repeat through the Table of Neptune's Moons in surface order:
say "[moon entry] has a surface best described as [surface entry].";
say "Fourth run.";
repeat through the Table of Neptune's Moons in reverse surface order:
say "[moon entry] has a surface best described as [surface entry].";

View file

@ -1,5 +1,3 @@
The Brahms Conservatoire is a room.
Colour is a kind of value. The colours are red, indigo and chartreuse.
Weight is a kind of value. 5kg specifies a weight.
@ -31,10 +29,11 @@ Joint magnitude relates a number (called N) to a number (called M) when N plus M
Definition: an text (called T) is lengthy if the number of characters in it is greater than 6.
When play begins:
To decide which number is the length of (T - an text) (this is length extraction):
decide on the number of characters in T.
To begin:
showme joint magnitude relation;
showme the location;
showme the list of colours;
showme txtng;
showme maximizing;
showme doubling applied to 2;
@ -46,10 +45,4 @@ When play begins:
showme the concatenation reduction of spelling out applied to { 3, 8, 4, 19, 7 };
showme the filter to lengthy texts of spelling out applied to { 3, 8, 4, 19, 7 };
showme filter to lengthy texts of spelling out applied to {15, 2, 20, 29, -4};
To decide which number is the length of (T - an text) (this is length extraction):
decide on the number of characters in T.
When play begins:
showme length extraction applied to "Hello world!";
showme the length of "podgorny".
showme the filter to negative numbers of {-2, -1, 0, 1, 2, 4, 7}.

View file

@ -0,0 +1,48 @@
Colour is a kind of value. The colours are red, indigo and chartreuse.
Weight is a kind of value. 5kg specifies a weight.
To decide what number is double (N - a number) (this is doubling):
decide on N plus N.
To decide what number is the square of (N - a number) (this is squaring):
decide on N times N.
To decide what text is the longhand form of (N - a number) (this is spelling out):
decide on "[N in words]".
To decide what text is the consonant form of (T - text) (this is txtng):
replace the regular expression "<aeiou>" in T with "", case insensitively;
decide on T.
To decide what number is the larger of (N - number) and (M - number) (this is maximizing):
if N > M, decide on N;
decide on M.
To decide what number is the sum of (N - number) and (M - number) (this is summing):
decide on N + M.
To decide what text is the concatenation of (X - text) and (Y - text) (this is concatenation):
decide on "[X][Y]".
Joint magnitude relates a number (called N) to a number (called M) when N plus M is greater than 7.
Definition: an text (called T) is lengthy if the number of characters in it is greater than 6.
To decide which number is the length of (T - an text) (this is length extraction):
decide on the number of characters in T.
To begin:
showme joint magnitude relation;
showme txtng;
showme maximizing;
showme doubling applied to 2;
showme txtng applied to spelling out applied to doubling applied to { 3, 8, 4, 19, 7 };
showme the maximizing reduction of { 3, 8, 4, 19, 7 };
showme the filter to even numbers of { 3, 8, 4, 19, 7 };
showme the maximizing reduction of { -3, -8, -4, -19, -7 };
showme the summing reduction of { 3, 8, 4, 19, 7 };
showme the concatenation reduction of spelling out applied to { 3, 8, 4, 19, 7 };
showme the filter to lengthy texts of spelling out applied to { 3, 8, 4, 19, 7 };
showme filter to lengthy texts of spelling out applied to {15, 2, 20, 29, -4};
showme the filter to negative numbers of {-2, -1, 0, 1, 2, 4, 7}.

View file

@ -0,0 +1,6 @@
That's even.
It would seem to be 4.
That's odd.
That's even.
It would seem to be 6.
That's odd.

View file

@ -0,0 +1,7 @@
That's even.
It would seem to be 4.
That's odd.
That's even.
It would seem to be 6.
That's odd.

View file

@ -0,0 +1,5 @@
phrase number -> number: doubling
"doubling applied to 2" = number: 4
phrase text -> number: length extraction
"length extraction applied to "Hello world!"" = number: 12
"length of "Hello world!"" = number: 12

View file

@ -0,0 +1,6 @@
phrase number -> number: doubling
"doubling applied to 2" = number: 4
phrase text -> number: length extraction
"length extraction applied to "Hello world!"" = number: 12
"length of "Hello world!"" = number: 12

View file

@ -0,0 +1,12 @@
"M" = number: 1
"M" = number: 2
"M" = number: 3
"M" = number: 4
"M" = number: 6
"M" = number: 7
"K" = number: 1
"K" = number: 2
"K" = number: 3
"K" = number: 4
"K" = number: 6
"K" = number: 7

View file

@ -0,0 +1,13 @@
"M" = number: 1
"M" = number: 2
"M" = number: 3
"M" = number: 4
"M" = number: 6
"M" = number: 7
"K" = number: 1
"K" = number: 2
"K" = number: 3
"K" = number: 4
"K" = number: 6
"K" = number: 7

View file

@ -2,3 +2,4 @@
"whether or not 31 pleases us" = truth state: true
"whether or not -417 displeases us" = truth state: false
"whether or not a fruit is tasty" = truth state: true
I begin.

View file

@ -3,3 +3,4 @@
"whether or not 31 pleases us" = truth state: true
"whether or not -417 displeases us" = truth state: false
"whether or not a fruit is tasty" = truth state: true
I begin.

View file

@ -0,0 +1,6 @@
"default value of number" = number: 0
"default value of colour" = colour: red
"default value of fruit" = fruit: apple
"default value of truth state" = truth state: false
"default value of text" = text:
"default value of distance" = distance: 0km

View file

@ -0,0 +1,7 @@
"default value of number" = number: 0
"default value of colour" = colour: red
"default value of fruit" = fruit: apple
"default value of truth state" = truth state: false
"default value of text" = text:
"default value of distance" = distance: 0km

View file

@ -0,0 +1,6 @@
You read back:
Observations in the Pottingham Green Case
Here's a comment.
Here's a secomd comment.

View file

@ -0,0 +1,20 @@
Table of Selected Numbers
(row 1) | 4 | four |
(row 2) | 3 | three |
(row 3) | 154 | one hundred and fifty-four |
(row 4) | 27 | twenty-seven |
(row 5) | 9 | nine |
(row 6) | -- --
(row 7) | -- --
(row 8) | -- --
(row 9) | -- --
Table of Reselected Numbers
(row 1) | 4 | four |
(row 2) | 3 | three |
(row 3) | 154 | one hundred and fifty-four |
(row 4) | 27 | twenty-seven |
(row 5) | 9 | nine |
(row 6) | -- --
(row 7) | -- --
(row 8) | -- --
(row 9) | -- --

View file

@ -0,0 +1,6 @@
Yes, 1 is 1.
Yes, 1 is 1.
Yes, 1 is 1.
One.
Two.
Something larger.

View file

@ -0,0 +1,7 @@
Yes, 1 is 1.
Yes, 1 is 1.
Yes, 1 is 1.
One.
Two.
Something larger.

View file

@ -0,0 +1,145 @@
"N" = number: 31
"N" = number: 94
"N" = number: 47
"N" = number: 142
"N" = number: 71
"N" = number: 214
"N" = number: 107
"N" = number: 322
"N" = number: 161
"N" = number: 484
"N" = number: 242
"N" = number: 121
"N" = number: 364
"N" = number: 182
"N" = number: 91
"N" = number: 274
"N" = number: 137
"N" = number: 412
"N" = number: 206
"N" = number: 103
"N" = number: 310
"N" = number: 155
"N" = number: 466
"N" = number: 233
"N" = number: 700
"N" = number: 350
"N" = number: 175
"N" = number: 526
"N" = number: 263
"N" = number: 790
"N" = number: 395
"N" = number: 1186
"N" = number: 593
"N" = number: 1780
"N" = number: 890
"N" = number: 445
"N" = number: 1336
"N" = number: 668
"N" = number: 334
"N" = number: 167
"N" = number: 502
"N" = number: 251
"N" = number: 754
"N" = number: 377
"N" = number: 1132
"N" = number: 566
"N" = number: 283
"N" = number: 850
"N" = number: 425
"N" = number: 1276
"N" = number: 638
"N" = number: 319
"N" = number: 958
"N" = number: 479
"N" = number: 1438
"N" = number: 719
"N" = number: 2158
"N" = number: 1079
"N" = number: 3238
"N" = number: 1619
"N" = number: 4858
"N" = number: 2429
"N" = number: 7288
"N" = number: 3644
"N" = number: 1822
"N" = number: 911
"N" = number: 2734
"N" = number: 1367
"N" = number: 4102
"N" = number: 2051
"N" = number: 6154
"N" = number: 3077
"N" = number: 9232
"N" = number: 4616
"N" = number: 2308
"N" = number: 1154
"N" = number: 577
"N" = number: 1732
"N" = number: 866
"N" = number: 433
"N" = number: 1300
"N" = number: 650
"N" = number: 325
"N" = number: 976
"N" = number: 488
"N" = number: 244
"N" = number: 122
"N" = number: 61
"N" = number: 184
"N" = number: 92
"N" = number: 46
"N" = number: 23
"N" = number: 70
"N" = number: 35
"N" = number: 106
"N" = number: 53
"N" = number: 160
"N" = number: 80
"N" = number: 40
"N" = number: 20
"N" = number: 10
"N" = number: 5
"N" = number: 16
"N" = number: 8
"N" = number: 4
"N" = number: 2
"M" = number: 1
"M" = number: 2
"M" = number: 3
"M" = number: 4
"M" = number: 5
"C" = colour: orange
"C" = colour: yellow
"C" = colour: green
"C" = colour: blue
"C" = colour: indigo
"C2" = colour: red
"C2" = colour: orange
"C2" = colour: yellow
"C2" = colour: green
"C2" = colour: blue
"C2" = colour: indigo
"C2" = colour: violet
"K" = number: 2
"K" = number: 3
"K" = number: 5
"K" = number: 7
"K" = number: 11
"K" = number: 13
First run.
Nereid has a surface best described as utterly unknown.
Triton has a surface best described as cryovolcanic ridges.
Proteus has a surface best described as highly irregular and sooty.
Second run.
Proteus has a surface best described as highly irregular and sooty.
Triton has a surface best described as cryovolcanic ridges.
Nereid has a surface best described as utterly unknown.
Third run.
Triton has a surface best described as cryovolcanic ridges.
Proteus has a surface best described as highly irregular and sooty.
Nereid has a surface best described as utterly unknown.
Fourth run.
Nereid has a surface best described as utterly unknown.
Proteus has a surface best described as highly irregular and sooty.
Triton has a surface best described as cryovolcanic ridges.

View file

@ -0,0 +1,146 @@
"N" = number: 31
"N" = number: 94
"N" = number: 47
"N" = number: 142
"N" = number: 71
"N" = number: 214
"N" = number: 107
"N" = number: 322
"N" = number: 161
"N" = number: 484
"N" = number: 242
"N" = number: 121
"N" = number: 364
"N" = number: 182
"N" = number: 91
"N" = number: 274
"N" = number: 137
"N" = number: 412
"N" = number: 206
"N" = number: 103
"N" = number: 310
"N" = number: 155
"N" = number: 466
"N" = number: 233
"N" = number: 700
"N" = number: 350
"N" = number: 175
"N" = number: 526
"N" = number: 263
"N" = number: 790
"N" = number: 395
"N" = number: 1186
"N" = number: 593
"N" = number: 1780
"N" = number: 890
"N" = number: 445
"N" = number: 1336
"N" = number: 668
"N" = number: 334
"N" = number: 167
"N" = number: 502
"N" = number: 251
"N" = number: 754
"N" = number: 377
"N" = number: 1132
"N" = number: 566
"N" = number: 283
"N" = number: 850
"N" = number: 425
"N" = number: 1276
"N" = number: 638
"N" = number: 319
"N" = number: 958
"N" = number: 479
"N" = number: 1438
"N" = number: 719
"N" = number: 2158
"N" = number: 1079
"N" = number: 3238
"N" = number: 1619
"N" = number: 4858
"N" = number: 2429
"N" = number: 7288
"N" = number: 3644
"N" = number: 1822
"N" = number: 911
"N" = number: 2734
"N" = number: 1367
"N" = number: 4102
"N" = number: 2051
"N" = number: 6154
"N" = number: 3077
"N" = number: 9232
"N" = number: 4616
"N" = number: 2308
"N" = number: 1154
"N" = number: 577
"N" = number: 1732
"N" = number: 866
"N" = number: 433
"N" = number: 1300
"N" = number: 650
"N" = number: 325
"N" = number: 976
"N" = number: 488
"N" = number: 244
"N" = number: 122
"N" = number: 61
"N" = number: 184
"N" = number: 92
"N" = number: 46
"N" = number: 23
"N" = number: 70
"N" = number: 35
"N" = number: 106
"N" = number: 53
"N" = number: 160
"N" = number: 80
"N" = number: 40
"N" = number: 20
"N" = number: 10
"N" = number: 5
"N" = number: 16
"N" = number: 8
"N" = number: 4
"N" = number: 2
"M" = number: 1
"M" = number: 2
"M" = number: 3
"M" = number: 4
"M" = number: 5
"C" = colour: orange
"C" = colour: yellow
"C" = colour: green
"C" = colour: blue
"C" = colour: indigo
"C2" = colour: red
"C2" = colour: orange
"C2" = colour: yellow
"C2" = colour: green
"C2" = colour: blue
"C2" = colour: indigo
"C2" = colour: violet
"K" = number: 2
"K" = number: 3
"K" = number: 5
"K" = number: 7
"K" = number: 11
"K" = number: 13
First run.
Nereid has a surface best described as utterly unknown.
Triton has a surface best described as cryovolcanic ridges.
Proteus has a surface best described as highly irregular and sooty.
Second run.
Proteus has a surface best described as highly irregular and sooty.
Triton has a surface best described as cryovolcanic ridges.
Nereid has a surface best described as utterly unknown.
Third run.
Triton has a surface best described as cryovolcanic ridges.
Proteus has a surface best described as highly irregular and sooty.
Nereid has a surface best described as utterly unknown.
Fourth run.
Nereid has a surface best described as utterly unknown.
Proteus has a surface best described as highly irregular and sooty.
Triton has a surface best described as cryovolcanic ridges.

View file

@ -0,0 +1,13 @@
relation of numbers: joint magnitude relation
phrase text -> text: txtng
phrase (number, number) -> number: maximizing
"doubling applied to 2" = number: 4
"txtng applied to spelling out applied to doubling applied to { 3, 8, 4, 19, 7 }" = list of texts: {"sx", "sxtn", "ght", "thrty-ght", "frtn"}
"maximizing reduction of { 3, 8, 4, 19, 7 }" = number: 19
"filter to even numbers of { 3, 8, 4, 19, 7 }" = list of numbers: {8, 4}
"maximizing reduction of { -3, -8, -4, -19, -7 }" = number: -3
"summing reduction of { 3, 8, 4, 19, 7 }" = number: 41
"concatenation reduction of spelling out applied to { 3, 8, 4, 19, 7 }" = text: threeeightfournineteenseven
"filter to lengthy texts of spelling out applied to { 3, 8, 4, 19, 7 }" = list of texts: {"nineteen"}
"filter to lengthy texts of spelling out applied to { 15, 2, 20, 29, -4 }" = list of texts: {"fifteen", "twenty-nine", "minus four"}
"filter to negative numbers of { -2, -1, 0, 1, 2, 4, 7 }" = list of numbers: {-2, -1}

View file

@ -1,7 +1,5 @@
Brahms Conservatoire
relation of numbers: joint magnitude relation
"location" = object: Brahms Conservatoire
"list of colours" = list of colours: {red, indigo, chartreuse}
phrase text -> text: txtng
phrase (number, number) -> number: maximizing
"doubling applied to 2" = number: 4
@ -13,14 +11,4 @@
"concatenation reduction of spelling out applied to { 3, 8, 4, 19, 7 }" = text: threeeightfournineteenseven
"filter to lengthy texts of spelling out applied to { 3, 8, 4, 19, 7 }" = list of texts: {"nineteen"}
"filter to lengthy texts of spelling out applied to { 15, 2, 20, 29, -4 }" = list of texts: {"fifteen", "twenty-nine", "minus four"}
"length extraction applied to "Hello world!"" = number: 12
"length of "podgorny"" = number: 8
Welcome
An Interactive Fiction
Release 1 / Serial number 160428 / Inform 7 build 9Z99 (I6/v6.34 lib 6/12N) SD
Brahms Conservatoire
> > Brahms Conservatoire
> Are you sure you want to quit?
"filter to negative numbers of { -2, -1, 0, 1, 2, 4, 7 }" = list of numbers: {-2, -1}

View file

@ -1,4 +0,0 @@
Home is a room.
When play begins:
showme the filter to negative numbers of {-2, -1, 0, 1, 2, 4, 7}.

View file

@ -1,10 +0,0 @@
Home
"filter to negative numbers of { -2, -1, 0, 1, 2, 4, 7 }" = list of numbers: {-2, -1}
Welcome
An Interactive Fiction
Release 1 / Serial number 160428 / Inform 7 build 9Z99 (I6/v6.34 lib 6/12N) SD
Home
> > Home
> Are you sure you want to quit?

View file

@ -1,11 +1,11 @@
Inform 7.10.1 build 6Q21 has started.
I've now read your source text, which is 11 words long.
I've also read Basic Inform by Graham Nelson, which is 579 words long.
I've also read Standard Rules by Graham Nelson, which is 42688 words long.
I've also read Basic Inform by Graham Nelson, which is 6823 words long.
I've also read Standard Rules by Graham Nelson, which is 36475 words long.
I've also read English Language by Graham Nelson, which is 2328 words long.
Problem__ PM_KindUnalterable
>--> You wrote 'A person is a kind of room' (source text, line 2), but that
seems to contradict 'A person is a kind of thing' (the Standard Rules, line 378),
seems to contradict 'A person is a kind of thing' (the Standard Rules, line 373),
as a room and a thing are incompatible. (If a room were a kind of a thing
or vice versa there'd be no problem, but they aren't.)
Inform 7 has finished: 40 centiseconds used.
Inform 7 has finished: 41 centiseconds used.

View file

@ -1,11 +1,11 @@
Inform 7.10.1 build 6Q21 has started.
I've now read your source text, which is 11 words long.
I've also read Basic Inform by Graham Nelson, which is 1614 words long.
I've also read Standard Rules by Graham Nelson, which is 41690 words long.
I've also read Basic Inform by Graham Nelson, which is 6823 words long.
I've also read Standard Rules by Graham Nelson, which is 36475 words long.
I've also read English Language by Graham Nelson, which is 2328 words long.
Problem__ PM_KindsCircular
>--> You wrote 'A person is a kind of animal' (source text, line 3), but that
seems to contradict 'An animal is a kind of person' (the Standard Rules, line 615),
seems to contradict 'An animal is a kind of person' (the Standard Rules, line 610),
as it would make a circularity with an animal and a thing each being kinds
of the other.
Inform 7 has finished: 42 centiseconds used.
Inform 7 has finished: 40 centiseconds used.

View file

@ -1,7 +1,7 @@
Inform 7.10.1 build 6Q21 has started.
I've now read your source text, which is 84 words long.
I've also read Basic Inform by Graham Nelson, which is 579 words long.
I've also read Standard Rules by Graham Nelson, which is 42688 words long.
I've also read Basic Inform by Graham Nelson, which is 6823 words long.
I've also read Standard Rules by Graham Nelson, which is 36475 words long.
I've also read English Language by Graham Nelson, which is 2328 words long.
Problem__ PM_MasksRelation
>--> I don't want you to define a phrase with the wording you've used in in
@ -16,6 +16,6 @@ Problem__ PM_MasksRelation
because it could be misunderstood. There is already a definition of what it
means for something to be 'less than' something else, so this phrase
definition would look too much like testing whether 'X is less than Y'.
('The verb to be less than means the numerically-less-than relation' (the
Standard Rules, line 364).)
('The verb to be less than means the numerically-less-than relation' (Basic
Inform, line 144).)
Inform 7 has finished: 48 centiseconds used.

View file

@ -1,13 +1,13 @@
Inform 7.10.1 build 6Q21 has started.
I've now read your source text, which is 46 words long.
I've also read Basic Inform by Graham Nelson, which is 1614 words long.
I've also read Standard Rules by Graham Nelson, which is 41690 words long.
I've also read Basic Inform by Graham Nelson, which is 6823 words long.
I've also read Standard Rules by Graham Nelson, which is 36475 words long.
I've also read English Language by Graham Nelson, which is 2328 words long.
Problem__ PM_VarKOVClash
In Part SR2 - Variables and Rulebooks, Section SR2/3 - Used when ruling on
accessibility in the extension Standard Rules by Graham Nelson:
>--> You wrote 'The container in question is an object that varies' (the
Standard Rules, line 738): but the name supplied for this new variable is a
Standard Rules, line 733): but the name supplied for this new variable is a
piece of text which is not available because it has a rival meaning
already, as a result of definitions made elsewhere. (Sometimes these are
indirect: for instance, defining a column in a table called 'question' can
@ -18,7 +18,7 @@ In Part SR2 - Variables and Rulebooks, Section SR2/3 - Used when ruling on
defined which might cause this clash.
Problem__ PM_VarKOVClash
>--> You wrote 'The supporter in question is an object that varies' (the
Standard Rules, line 739): again, the name supplied for this new variable
Standard Rules, line 734): again, the name supplied for this new variable
is a piece of text which is not available because it has a rival meaning
already.
Inform 7 has finished: 42 centiseconds used.
Inform 7 has finished: 41 centiseconds used.

View file

@ -1,12 +1,12 @@
Inform 7.10.1 build 6Q21 has started.
I've now read your source text, which is 15 words long.
I've also read Basic Inform by Graham Nelson, which is 1614 words long.
I've also read Standard Rules by Graham Nelson, which is 41690 words long.
I've also read Basic Inform by Graham Nelson, which is 6823 words long.
I've also read Standard Rules by Graham Nelson, which is 36475 words long.
I've also read English Language by Graham Nelson, which is 2328 words long.
Problem__ PM_VariableContradiction
>--> You wrote 'The command prompt is "What do you want to do? >"' (source
text, line 3), but in another sentence 'The command prompt is ">"' (the
Standard Rules, line 767): but this looks like a contradiction, because the
Standard Rules, line 762): but this looks like a contradiction, because the
initial value of this variable seems to be being set in each of these
sentences, but with a different outcome.
Inform 7 has finished: 43 centiseconds used.
Inform 7 has finished: 41 centiseconds used.

View file

@ -56,6 +56,7 @@ variables mentioned below:
nonlocal_variable *i6_glob_VAR = NULL;
nonlocal_variable *i6_nothing_VAR = NULL; /* the I6 |nothing| constant */
nonlocal_variable *command_prompt_VAR = NULL; /* the command prompt text */
nonlocal_variable *parameter_object_VAR = NULL;
@ We record the one most recently made:
@ -71,7 +72,8 @@ hacky constructs which only the SR should ever refer to.
<notable-variables> ::=
i6-varying-global |
i6-nothing-constant |
command prompt
command prompt |
parameter-object
@ We can create a new variable provided we give its name, kind and scope.
When the scope isn't global, the variable is said to be "stacked", which is a
@ -123,6 +125,7 @@ nonlocal_variable *NonlocalVariables::new(wording W, kind *K, stacked_variable *
case 0: i6_glob_VAR = nlv; break;
case 1: i6_nothing_VAR = nlv; break;
case 2: command_prompt_VAR = nlv; break;
case 3: parameter_object_VAR = nlv; break;
}
}

View file

@ -13,7 +13,6 @@ property *P_action_bitmap = NULL;
nonlocal_variable *real_location_VAR = NULL;
nonlocal_variable *actor_location_VAR = NULL;
nonlocal_variable *parameter_object_VAR = NULL;
nonlocal_variable *I6_noun_VAR = NULL;
nonlocal_variable *I6_second_VAR = NULL;
@ -90,8 +89,7 @@ the Standard Rules or, in the case of "the X understood", by Inform itself.
actor-location | ==> 3
second noun | ==> 4
person asked | ==> 5
maximum score | ==> 6
parameter-object ==> 7
maximum score ==> 6
@ =
int PL::Parsing::Visibility::parsing_new_variable_notify(nonlocal_variable *var) {
@ -113,7 +111,6 @@ int PL::Parsing::Visibility::parsing_new_variable_notify(nonlocal_variable *var)
case 5: I6_actor_VAR = var; break;
case 6: max_score_VAR = var;
NonlocalVariables::make_initalisable(var); break;
case 7: parameter_object_VAR = var; break;
}
}
return FALSE;

View file

@ -0,0 +1,12 @@
(The current puzzle difficulty is set to easy.)
Alien Invasion Part 23
An Interactive Fiction
Release 1 / Serial number 160428 / Inform 7 build 9Z99 (I6/v6.34) SD
Sewer Junction
>Are you sure you want to quit?

View file

@ -1,13 +0,0 @@
Sewer Junction
Alien Invasion Part 23
An Interactive Fiction
Release 1 / Serial number 160428 / Inform 7 build 9Z99 (I6/v6.34 lib 6/12N) SD
Sewer Junction
> > Sewer Junction
*** Error on file 'prefs': external files can only be used under Glulx ***
*** Run-time problem P48: Error handling external file.
> Are you sure you want to quit?

View file

@ -0,0 +1,11 @@
The Fifth Body
An Interactive Fiction
Release 1 / Serial number 160428 / Inform 7 build 9Z99 (I6/v6.34) SD
Vestry
Detective Havers hangs back by the door: the forensics expert is not finished with a preliminary examination of the body. From here you can't see much, except that the expert has peeled back and laid to one side a liturgical vestment that someone at the church used to cover the corpse until the police came. What was once a cream silk with festive Easter embroidery is now stained with blood-colored handprints.
>Are you sure you want to quit?

View file

@ -1,15 +0,0 @@
Vestry
*** Error on file 'notebook': external files can only be used under Glulx ***
*** Run-time problem P48: Error handling external file.
*** Error on file 'barbara': external files can only be used under Glulx ***
The Fifth Body
An Interactive Fiction
Release 1 / Serial number 160428 / Inform 7 build 9Z99 (I6/v6.34 lib 6/12N) SD
Vestry
Detective Havers hangs back by the door: the forensics expert is not finished with a preliminary examination of the body. From here you can't see much, except that the expert has peeled back and laid to one side a liturgical vestment that someone at the church used to cover the corpse until the police came. What was once a cream silk with festive Easter embroidery is now stained with blood-colored handprints.
> > Vestry
> Are you sure you want to quit?

View file

@ -0,0 +1,13 @@
The Fourth Body
An Interactive Fiction
Release 1 / Serial number 160428 / Inform 7 build 9Z99 (I6/v6.34) SD
Damp Hillside
It is just after dawn: among the trees there is misty and pale blue light. The only saturated color in view is the orange-and-yellow jacket of Detective Havers. She is trying unsuccessfully to light a cigarette.
The body itself is further down, closer to the bottom of the ravine. It would be foolish to speculate before seeing it, but the odds are that the corpse was rolled down after death. The ground is not steep enough for the fall itself to be deadly.
>Are you sure you want to quit?

View file

@ -1,17 +0,0 @@
Damp Hillside
*** Error on file 'notebook': external files can only be used under Glulx ***
*** Run-time problem P48: Error handling external file.
*** Error on file 'barbara': external files can only be used under Glulx ***
The Fourth Body
An Interactive Fiction
Release 1 / Serial number 160428 / Inform 7 build 9Z99 (I6/v6.34 lib 6/12N) SD
Damp Hillside
It is just after dawn: among the trees there is misty and pale blue light. The only saturated color in view is the orange-and-yellow jacket of Detective Havers. She is trying unsuccessfully to light a cigarette.
The body itself is further down, closer to the bottom of the ravine. It would be foolish to speculate before seeing it, but the odds are that the corpse was rolled down after death. The ground is not steep enough for the fall itself to be deadly.
> > Damp Hillside
> Are you sure you want to quit?

View file

@ -0,0 +1,11 @@
Labyrinth of Ghosts
An Interactive Fiction
Release 1 / Serial number 160428 / Inform 7 build 9Z99 (I6/v6.34) SD
Gateway
For the foolhardy adventurer, the perilous labyrinth lies north, east or south.
>Are you sure you want to quit?

View file

@ -1,10 +0,0 @@
Gateway 0/1
Labyrinth of Ghosts
An Interactive Fiction
Release 1 / Serial number 150512 / Inform 7 build 6M22 (I6/v6.33 lib 6/12N) SD
Gateway
For the foolhardy adventurer, the perilous labyrinth lies north, east or south.
> > Gateway 0/1
> Are you sure you want to quit?

View file

@ -0,0 +1,13 @@
Flathead News Network
An Interactive Fiction
Release 1 / Serial number 160428 / Inform 7 build 9Z99 (I6/v6.34) SD
Newsroom
This is the secret nerve-centre of FNN, the Flathead News Network.
You can see a BBC button, a NASA button, a WHO button and a screen here.
>Are you sure you want to quit?

View file

@ -1,12 +0,0 @@
Newsroom
Flathead News Network
An Interactive Fiction
Release 1 / Serial number 150512 / Inform 7 build 6M22 (I6/v6.33 lib 6/12N) SD
Newsroom
This is the secret nerve-centre of FNN, the Flathead News Network.
You can see a BBC button, a NASA button, a WHO button and a screen here.
> > Newsroom
> Are you sure you want to quit?

View file

@ -6,6 +6,8 @@ gameinfo.dbg
makefile
*.glkdata
resources/Changes/Output/
resources/Changes/Output/META-INF/
resources/Changes/Output/OEBPS/

View file

@ -281,115 +281,6 @@ To alter the multiple object list to (L - list of objects)
(documented at ph_altermultipleobjectlist):
(- LIST_OF_TY_Set_Mol({-by-reference:L}); -).
@ The standard map and reduce operations found in most functional programming
languages:
=
Section SR5/2/20 - Values - Functional programming
To decide whether (val - K) matches (desc - description of values of kind K)
(documented at ph_valuematch):
(- {-primitive-definition:description-application} -).
To decide what K is (function - phrase nothing -> value of kind K) applied
(documented at ph_applied0):
(- {-primitive-definition:function-application} -).
To decide what L is (function - phrase value of kind K -> value of kind L)
applied to (input - K)
(documented at ph_applied1):
(- {-primitive-definition:function-application} -).
To decide what M is (function - phrase (value of kind K, value of kind L) -> value of kind M)
applied to (input - K) and (second input - L)
(documented at ph_applied2):
(- {-primitive-definition:function-application} -).
To decide what N is (function - phrase (value of kind K, value of kind L, value of kind M) -> value of kind N)
applied to (input - K) and (second input - L) and (third input - M)
(documented at ph_applied3):
(- {-primitive-definition:function-application} -).
To apply (function - phrase nothing -> nothing)
(documented at ph_apply0):
(- {-primitive-definition:function-application}; -).
To apply (function - phrase value of kind K -> nothing)
to (input - K)
(documented at ph_apply1):
(- {-primitive-definition:function-application}; -).
To apply (function - phrase (value of kind K, value of kind L) -> nothing)
to (input - K) and (second input - L)
(documented at ph_apply2):
(- {-primitive-definition:function-application}; -).
To apply (function - phrase (value of kind K, value of kind L, value of kind M) -> nothing)
to (input - K) and (second input - L) and (third input - M)
(documented at ph_apply3):
(- {-primitive-definition:function-application}; -).
To decide what list of L is (function - phrase K -> value of kind L) applied to (original list - list of values of kind K)
(documented at ph_appliedlist):
let the result be a list of Ls;
repeat with item running through the original list:
let the mapped item be the function applied to the item;
add the mapped item to the result;
decide on the result.
To decide what K is the (function - phrase (K, K) -> K) reduction of (original list - list of values of kind K)
(documented at ph_reduction):
let the total be a K;
let the count be 0;
repeat with item running through the original list:
increase the count by 1;
if the count is 1, now the total is the item;
otherwise now the total is the function applied to the total and the item;
decide on the total.
To decide what list of K is the filter to (criterion - description of Ks) of
(full list - list of values of kind K)
(documented at ph_filter):
let the filtered list be a list of K;
repeat with item running through the full list:
if the item matches the criterion:
add the item to the filtered list;
decide on the filtered list.
@h Using external resources.
The following all refer to "FileIO.i6t" and work only on Glulx.
=
Section SR5/2/21 - Values - Files (for Glulx external files language element only)
To read (filename - external file) into (T - table name)
(documented at ph_readtable):
(- FileIO_GetTable({filename}, {T}); -).
To write (filename - external file) from (T - table name)
(documented at ph_writetable):
(- FileIO_PutTable({filename}, {T}); -).
To decide if (filename - external file) exists
(documented at ph_fileexists):
(- (FileIO_Exists({filename}, false)) -).
To decide if ready to read (filename - external file)
(documented at ph_fileready):
(- (FileIO_Ready({filename}, false)) -).
To mark (filename - external file) as ready to read
(documented at ph_markfileready):
(- FileIO_MarkReady({filename}, true); -).
To mark (filename - external file) as not ready to read
(documented at ph_markfilenotready):
(- FileIO_MarkReady({filename}, false); -).
To write (T - text) to (FN - external file)
(documented at ph_writetext):
(- FileIO_PutContents({FN}, {T}, false); -).
To append (T - text) to (FN - external file)
(documented at ph_appendtext):
(- FileIO_PutContents({FN}, {T}, true); -).
To say text of (FN - external file)
(documented at ph_saytext):
(- FileIO_PrintContents({FN}); say__p = 1; -).
@ Figures and sound effects.
Ditto, but for "Figures.i6t".
@ -515,58 +406,6 @@ To decide what object is the actor part of (act - a action)
(documented at ph_actorpart):
(- (STORED_ACTION_TY_Part({-by-reference:act}, STORA_ACTOR_F)) -).
@ Firing off activities:
=
Section SR5/4/5 - Actions, activities and rules - Carrying out activities
To carry out the (A - activity on nothing) activity
(documented at ph_carryout):
(- CarryOutActivity({A}); -).
To carry out the (A - activity on value of kind K) activity with (val - K)
(documented at ph_carryoutwith):
(- CarryOutActivity({A}, {val}); -).
@ This is analogous to "continue the action":
=
To continue the activity
(documented at ph_continueactivity):
(- rfalse; -) - in to only.
@ Advanced activity phrases: for setting up one's own activities structured
around I7 source text. People tend not to use this much, and perhaps that's
a good thing, but it does open up possibilities, and it's good for
retro-fitting onto extensions to make the more customisable.
=
Section SR5/4/6 - Actions, activities and rules - Advanced activities
To begin the (A - activity on nothing) activity
(documented at ph_beginactivity):
(- BeginActivity({A}); -).
To begin the (A - activity on value of kind K) activity with (val - K)
(documented at ph_beginactivitywith):
(- BeginActivity({A}, {val}); -).
To decide whether handling (A - activity) activity
(documented at ph_handlingactivity):
(- (~~(ForActivity({A}))) -).
To decide whether handling (A - activity on value of kind K) activity with (val - K)
(documented at ph_handlingactivitywith):
(- (~~(ForActivity({A}, {val}))) -).
To end the (A - activity on nothing) activity
(documented at ph_endactivity):
(- EndActivity({A}); -).
To end the (A - activity on value of kind K) activity with (val - K)
(documented at ph_endactivitywith):
(- EndActivity({A}, {val}); -).
To abandon the (A - activity on nothing) activity
(documented at ph_abandonactivity):
(- AbandonActivity({A}); -).
To abandon the (A - activity on value of kind K) activity with (val - K)
(documented at ph_abandonactivitywith):
(- AbandonActivity({A}, {val}); -).
@h Rules.
Four different ways to invoke a rule or rulebook:

View file

@ -292,9 +292,6 @@ The item-pushed-between-rooms variable translates into I6 as "move_pushing".
The actor-location is an object that varies. [*]
The actor-location variable translates into I6 as "actor_location".
The parameter-object is an object that varies. [*]
The parameter-object variable translates into I6 as "parameter_value".
The scene being changed is a scene that varies. [*]
The scene being changed variable translates into I6 as "parameter_value".
@ -1167,13 +1164,6 @@ There is a small stock of built-in adjectives for values.
=
Section SR2/12 - Adjectival definitions
Definition: a number is even rather than odd if the remainder after dividing it by 2 is 0.
Definition: a number is positive if it is greater than zero.
Definition: a number is negative if it is less than zero.
Definition: a text is empty rather than non-empty if I6 routine
"TEXT_TY_Empty" says so (it contains no characters).
Definition: a text is substituted rather than unsubstituted if I6 routine
"TEXT_TY_IsSubstituted" says so (any square-bracketed text substitutions
in it have been made).