Topic understood and tables

Hello, all:

I wrote this topic about a year ago but I still have not been able to get the language to work. The item compiles, but regardless of whether or not the answer is the correct one the game treats it as incorrect:

aulknerword is text that varies.
Hemingwayword is text that varies.

faulknerhealth is a number that varies.  faulknerhealth is 5.
hemingwayhealth is a number that varies.  hemingwayhealth is 5.

faulknerrows is a number that varies.  faulknerrows is 0.

Hemingway_and_Faulkner_Fight is a scene.

Hemingway_and_Faulkner_Fight begins when faulknerbattle is 3 and faulknerrows is greater than 10.

Hemingway_and_Faulkner_Fight ends when faulknerbattle is 10.

answer mode is a truth state that varies.

guessing is an action applying to one topic.

understand "[text]" as guessing when answer mode is true.

every turn during Hemingway_and_Faulkner_Fight:
	if player is in Outside_the_Total_Perspective_Vortex:
		choose a random row in Table of Faulkner words;
		now Faulknerword is the Faulkner word entry;
		now Hemingwayword is the Hemingway word entry;
		blank out the whole row;
		say "Hemingway clears his throat and yells out a word:  [Hemingwayword]!";
		now the command prompt is "What is your guess of the Faulkner word response?  [faulknerword]>";
		now answer mode is true

check guessing:
	if the topic understood is not faulknerword:
		say "[Faulknerword]!  Wrong!  Faulkner screams in pain!";
		decrease faulknerhealth by 1;
		now answer mode is false;
		if faulknerhealth is 0:
			now faulknerbattle is 10;
			now the command prompt is ">".

carry out guessing a topic:
	if topic understood is faulknerword:
		say "[Faulknerword]!  Correct!  Hemingway screams in pain!";
		increase the score by one;
		if hemingwayhealth is 0:
			now faulknerbattle is 10;
			now the command prompt is ">";
		otherwise:
			say "[Faulknerword]! Wrong!  Faulkner screams in pain!";
			decrease faulknerhealth by 1;
			now answer mode is false;
			if faulknerhealth is 0:
				now faulknerbattle is 10;
				now the command prompt is ">".

Before doing anything other than guessing:
	if answer mode is true:
		say "(ignoring the question)[line break]";
	now answer mode is false.``

in thinking about this, I am wondering if my table needs to be set up with the Faulkner Word entry being “topic” instead of "text


Table of Faulkner words
Faulkner word (text)	Hemingway word (text)	Defined (value)
with 60 blank rows

From the partial code that you provided, it’s not really clear what you’re trying to accomplish. It looks like you want a table-driven guessing game of sorts.

Two things I can suggest that you check:

  1. The “is” operator doesn’t always do what you expect. Given the table structure that you have described, you may want matches the text. (See Writing with Inform 20.5 Matching and exactly matching for details.)

  2. Your check guessing... and carry out guessing... rules may be a bit at odds with each other. I suggest that you look over Writing with Inform 12.2 How actions are processed to make sure that you’re using the correct rulebooks for the job.

If the above is not useful, you might try describing what you want the code to do in more detail and/or providing a sample transcript of the kind of interaction that you want.

Thank you, your help led me to the solution!