I7: saying a thing's property in relation to another thing?

I’m looking for a concise way to say a thing’s property in relation to another thing – apologies if that’s a little confusing, I’m still getting the basics of I7 figured out. I’m looking for something concise as I have a lot of things and I’m trying to minimize extra typing. Currently I’m generating I7 code with regular expression matching in a separate text editor, but I’m wondering if there’s an easier way to just write it in I7.

What I have are a bunch of things with properties containing text, like this:

A tool has some text called vs concertina wire.
A tool has some text called vs electric fence.
A tool has some text called vs watchtower.
A tool has some text called vs dogs.

Where a tool is a kind of thing. Then I want to say this property when comparing a particular tool against another thing, if the particular tool has a non-empty property. So it looks like this:

The silk map cancels exposed terrain. 
The vs exposed terrain of the silk map is "testing."

Where ‘canceling’ is a relation between tools and another kind, obstacles (of which exposed terrain is a member).

Currently I’m getting at this in a big switch statement, that looks like:

To say (T - a tool) vs (O - an obstacle):
	if O is:
		-- concertina wire: say vs concertina wire of T;
		-- electric fence: say vs electric fence of T;

Then a test of all of this looks like:

When play begins:
	repeat through the Table of Enemy Obstacles:
		if the silk map cancels the obstacle entry:
			say the silk map vs obstacle entry. 

So, to make a long story short – is there an easier way to ‘say the silk map vs obstacle entry’?

My recommendation is to use tables instead of separate properties for each obstacle. You could make one big table listing the text for each combination of tool and obstacle, or give each tool a table-name property pointing to its own table which would only need to list the obstacle and text. With one big table, you’d have to use a loop to find the matching row; with separate tables, you’d have simpler code (“let tbl be the obstacle text table of T; if O is an obstacle listed in tbl, say the quip entry;”) but you’d need more definitions.

I had started off with a big table, but found a bug in the number of columns allowed (which will be fixed, but in the next release I’m guessing) that made that unworkable – I wasn’t sure about using individual tables, thanks for the suggestion.

edit: yep, that’s way more concise than what I had :slight_smile: . Didn’t need the relation or the switch statement at all.

Ah… if you were hitting the column limit, I imagine you had something like this:Table of Obstacle Text tool vs concertina wire vs electric fence ... silk map "blah" "blah" ...
I was thinking of something more like this:[code]Table of Obstacle Text
tool obstacle quip
silk map concertina wire “blah”
silk map electric fence “blah”

To decide which text is the quip for (T - tool) vs (O - obstacle):
repeat through the Table of Obstacle Text:
if the tool entry is T and the obstacle entry is O, decide on the quip entry;
decide on “”.[/code]

Yes, I was doing your first example – the second didn’t even occur to me, as I was creating the things from the table.