Strange Inform 7 Facts (post yours here!)

I thought maybe someone in the future could benefit from a catalog(ue) of the little idiosyncrasies that make Inform 7 so much “fun”. I’ll start off…

And the subject is: disambiguating actions applying to two things. I checked, and you won’t find this in Writing with Inform (WWI). Consider the following:

"Strange Disambiguation"

Lab is a room. The ball is in the lab. The machine is in the lab.

Frotzing it with is an action applying to two things. Understand "frotz [something] with [something]" as frotzing it with.

Blorbing it with is an action applying to two things. Understand "blorb [something] with [something]" as blorbing it with.

Rezroving it with is an action applying to two things. Understand "rezrov [something] with [something]" as rezroving it with.

Does the player mean frotzing the ball with something: it is very unlikely;

Does the player mean blorbing something with the ball: it is very unlikely;

Does the player mean rezroving the ball with: it is very unlikely;

Report frotzing something with something:
	say "frotzed.";

Report blorbing something with something:
	say "blorbed.";

Report rezroving something with something:
	say "rezroved.";
test me with "frotz/ball/machine/blorb/ball/rezrov/ball";

Run “test me” and you’ll see that the “does the player mean” (DTPM) rule for frotzing does nothing, the rule for blorbing chooses the machine for the second noun, and the rule for rezroving chooses the ball for the first noun.

As I mentioned, WWI says nothing about the ineffectiveness of the first DTPM rule, or the existence of the third form. I sat with this for a while before desperate experimentation led me to the solution for proper disambiguation of the first noun.


I don’t know if this is odd or not. I’ve had similar issues with “Does the player mean” rules. I always assumed DTPM was only adding weight to avoid disambiguation but not intended to prevent an action - like if the ball is obviously the most likely thing to rezrov and it’s in scope that’s what it will favor. It also is meant to avoid accidentally cluing the player what the correct option is. DTPM shouldn’t prevent an action the player specifies; it only assists the parser in making a choice when the player types a bare verb.

I also wonder (but am not certain) if there might be better ways to write your rules, like Does the player mean rezroving it with when the second noun is the ball:

The other oddity is since your example only has two objects in the game world, DTPM rules aren’t really getting a workout since there’s not a whole lot for disambiguation to be confused over. If there’s only one item in scope, the parser will pick that, even if it’s “very unlikely”.

1 Like

The reason this came up is that my code was picking the player as the most likely thing to insert into a card key lock, and I couldn’t get the scores to change when I looked at the parser trace. It took me a while to determine that eliminating [something] as the second noun from the DTPM rule would make it work. If it’s not odd, it at least seems extremely subtle what the difference here should be.

Following WI, all of the examples therein use the form Does the player mean throwing the can of shoe polish at the shoe polish vending machine: it is likely. But that doesn’t mean it’s the best way.

1 Like

Inform doesn’t just support recursion, it supports infinite recursion.

Terrapin is a room.
Chelonian is a container in the Terrapin.
The map region of Terrapin is Chelonian.

When play begins:
if the Terrapin is in the Chelonian and the Chelonian is in the Terrapin,
  say "It's turtles all the way down."