Putting "or" in a list instead of "and"

I have text saying, for instance, “you can move your king to b8, c8, c7 and c6.” But it would technically be more grammatically accurate to say “you can move your king to b8, c8, c7 or c6.”

So I have this code comparing the shorthand “list of adjacent rooms” with something longer. But what I’m wondering is, is there shorthand Inform 7 that says “[list of adjacent rooms with conjunction = or]”?

every turn:
	say "[list of adjacent rooms].";
	let x be number of adjacent rooms;
	let count be 0;
	repeat with rm running through adjacent rooms:
		increment count;
		say "[rm]";
		if count < x - 1, say ", ";
		if count is x - 1, say " or ";
	say ".";

In a clunky fashion…

or-not-and is initially false.

L is initially {1 , 2, 3};

For issuing the response text of the list writer internal rule response (C) when or-not-and is true: say " or ".

when play begins:
  now or-not-and is true;
  say L;

There’s a bunch of ways to make that better, but I have to go now. :smile:

3 Likes