Proof of concept!
[spoiler][code]“connectors”
Volume - The Connector Kind
Book - A Connector
A connector is a kind of thing. A connector has a number called the carrying capacity. The carrying capacity of a connector is usually 2. A connector can be leavable or draggable.
Book - Relations
Part - Encompassment - Enclosure or Identity
Encompassment relates a thing (called the whole) to a thing (called the component) when the whole is the component or the whole encloses the component.
The verb to encompass (he encompasses, they encompass, he encompassed, it is encompassed, he is encompassing) implies the encompassment relation.
Part - Connection
Connection relates one connector to various things. The verb to connect to (he connects to, they connect to, he connected to, it is connected to, he is connecting to) implies the connection relation.
The verb to be connected to implies the reversed connection relation.
Definition: A connector (called the rope) is used up rather than free:
Let used ends be the number of things connected to the rope;
Decide on whether or not used ends is at least the carrying capacity of the rope.
Part - Attachment - Reversable Connection
Attachment relates a thing (called the first item) to a thing (called the second item) when the first item connects to the second item or the second item connects to the first item.
The verb to be attached to implies the attachment relation.
Part - Linkage - Indirect Attachment
Chapter - The Anchor - An Object Ceiling
To decide which thing is the anchor of (component - a thing):
let H be the not-counting-parts holder of component;
while H is a thing:
now component is H;
now H is the not-counting-parts holder of component;
decide on component;
Chapter - Whether a Connector Binds a Thing to Another Thing
To decide whether (the link - a thing) bind/binds (the prisoner - a thing) to (the chain - a thing):
unless the link is a connector, no;
Now the chain is the anchor of the chain;
unless the chain encompasses the link, no;
Now the prisoner is the anchor of the prisoner;
Repeat with the appendage running through things encompassed by the prisoner:
if the link connects to the appendage, yes;
no.
Chapter - Whether a Thing is Indirectly Attached to a Thing
To decide whether (first item - a thing) is/are indirectly attached to (second item - a thing):
Repeat with the link running through connectors:
if the link binds first item to second item, yes;
if the link binds second item to first item, yes;
no.
Chapter - The Linkage Relation
Linkage relates a thing (called the first item) to a thing (called the second item) when the first item is indirectly attached to the second item.
The verb to be linked to implies the linkage relation.
Chapter - Static Linkage - for Pathfinding
Static linkage relates various connectors to various connectors. The verb to be statically linked to implies the static linkage relation.
Volume - Verbs
Book - Connecting
Part - Grammar
Understand “to” and “onto” and “on to” and “with” as “[onto]”
Understand “tie [something] [onto] [something]” as tying it to.
Understand “attach [something] [onto] [something]” as tying it to.
Understand “connect [something] [onto] [something]” as tying it to.
Part - Action
Check inserting something into a connector (this is the convert inserting into a connector to tying rule):
try tying the second noun to the noun instead.
Check tying something that is not a connector to a connector (this is the reverse nouns when tying a non-connector to a connector rule):
try tying the second noun to the noun instead.
Check tying a used up connector to something (this is the can’t tie without a free end rule):
if the second noun is a free connector:
say “(Connecting a free end of [the second noun] to [the noun])[command clarification break]”;
Silently try tying the second noun to the noun;
otherwise:
say “[The noun] doesn’t have a free end.”;
stop the action.
Check tying a connector to something when the noun is attached to the second noun (this is the can’t make two connections to one thing rule):
say “[The noun] is already attached to [the second noun]” instead;
Check tying a connector to a connector (this is the can’t connect a connector to itself rule):
if the second noun is the noun, say “There’s no need to connect [the noun] to itself.” instead;
Carry out tying a connector to something:
Now the noun connects to the second noun.
Report tying something to something:
say “You connect [the noun] to [the second noun].”;
Book - Disconnecting
Part - Grammar
Understand “from” and “out of” as “[out of]”.
Understand “off” and “off of” as “[off of]”.
Understand “from [off of]” and “[off of]” and “off [out of]” and “[out of]” as “[off out of]”.
Understand “take [something] [off out of] [something]” as removing it from.
Understand “get [something] [off out of] [something]” as removing it from.
Understand “remove [something] [off out of] [something]” as removing it from.
Understand “pull [something] [off out of] [something]” as removing it from.
[Understand “pull [things inside] [off out of] [something]” as removing it from.]
Understand the command “disconnect” as “remove”.
Understand the command “detach” as “remove”.
Does the player mean removing something from something that is attached to the noun: It is very likely.
Does the player mean removing something from something that is linked to the noun: It is likely.
Part - Action
Chapter - Removing Something From a Connector
Check removing something from a connector (This is the can’t remove from a connector rule):
say “[The noun] isn’t connected to [the second noun].” instead;
The can’t remove from a connector rule is listed first in the check removing it from rulebook.
Check removing something from something that is linked to the noun (this is the redirect removal to compound disconnecting rule):
Let first anchor be the anchor of the noun;
Let second anchor be the anchor of the second noun;
Repeat with the link running through connectors encompassed by first anchor:
repeat with component running through things encompassed by second anchor:
if the link connects to component, try disconnecting the link from component;
Repeat with the link running through connectors encompassed by second anchor:
repeat with component running through things encompassed by first anchor:
if the link connects to component, try disconnecting the link from component;
stop the action.
The redirect removal to compound disconnecting rule is listed first in the check removing it from rulebook.
Check removing something from something that is attached to the noun (this is the redirect removal to simple disconnecting rule):
Try disconnecting the noun from the second noun instead.
The redirect removal to simple disconnecting rule is listed first in the check removing it from rulebook.
Check removing a connector from something that is not a connector (this is the reverse nouns when removing a connector from a non-connector rule):
Try removing the second noun from the noun instead.
The reverse nouns when removing a connector from a non-connector rule is listed first in the check removing it from rulebook.
Chapter - The Disconnecting Action
Disconnecting it from is an action applying to two things.
Check disconnecting something from something that is not attached to the noun:
say “[The noun] isn’t attached to [the second noun].” instead.
Carry out disconnecting something from:
if the noun is a connector, now the noun does not connect to the second noun;
if the second noun is a connector, now the second noun does not connect to the noun;
Report disconnecting something from:
say “You disconnect [the noun] from [the second noun].”
Book - Dragging
To decide whether (I - an object) comes after (J - an object): (- {I} > {J} -)
To decide whether (start - a thing) is remotely linked to (end - a thing):
let loc be the location of start;
if loc is not the location of end, no;
if no connector is linked to start, no;
if no connector is linked to end, no;
Repeat with link running through connectors in loc:
Now every connector is not statically linked to link;
Repeat with link running through connectors in loc:
Repeat with second link running through connectors in loc:
if second link comes after link and second link is linked to link:
now link is statically linked to second link;
now second link is statically linked to link;
Repeat with starting link running through connectors linked to start:
Repeat with ending link running through connectors linked to end:
If the number of steps via the static linkage relation from starting link to ending link is not -1, yes;
no;
Check going when the player is linked to something:
Repeat with the shackle running through fixed in place things in the location:
if the player is remotely linked to the shackle:
say “You can’t go anywhere because you’re connected to [the shackle].” instead;
Book - Testing
Cell is a room. A rope is a connector in cell. A bolt is a fixed in place thing in cell.
Corridor is south of Cell.
The rope connects to the bolt. The rope connects to yourself.
test me with “s/disconnect rope from bolt/s”
[/code][/spoiler]