mirror of
https://github.com/ganelson/inform.git
synced 2024-07-07 17:44:22 +03:00
29 lines
987 B
Plaintext
29 lines
987 B
Plaintext
Example: * Number Study
|
|
Location: Relations as values in their own right
|
|
RecipeLocation: Mathematics
|
|
Index: Numbers in relations
|
|
Description: The parity and joint magnitude relations explored.
|
|
For: Z-Machine
|
|
|
|
This is the same case given above, but expanded just slightly to demonstrate that the names of the relations can also be printed, if we like:
|
|
|
|
{*}"Number Study"
|
|
|
|
Abstraction is a room.
|
|
|
|
Parity relates a number (called N) to a number (called M) when N minus M is even.
|
|
|
|
Joint magnitude relates a number (called N) to a number (called M) when N plus M is greater than 7.
|
|
|
|
To chart (R - a relation of numbers):
|
|
repeat with N running from 1 to 5:
|
|
repeat with M running from 1 to 5:
|
|
if R relates N to M, say "[N] <=> [M] by [R][line break]";
|
|
|
|
When play begins:
|
|
let L be { parity relation, joint magnitude relation };
|
|
repeat with R running through L:
|
|
chart R.
|
|
|
|
As this shows, we can even form lists of relations. The kind of L is "list of relations of numbers".
|