If I were to use include (–) in i7, could I make a three fold action? I’m not asking how to, I’m asking if it’s possible.
EDIT it would be something like this: [code]Include(- global third; [thirdnoun x; x = parsetoken(elementarytt,noun_token; if(x==gpr_fail or gpr_reparse) return x; third =x; return gpr_preposition; ]
I’m not sure anybody has tested this solution with I7. It should be possible, in principle. However, you’re going to have a hard time inserting the general parsing function ThirdNoun into a grammar line. I don’t know a way to do that.
Oh, there is a way. I should have checked the docs first.
This works:
The Kitchen is a room.
The player carries a rock.
The player carries a stone.
The player carries a pebble.
Include (-
Global third;
-) after "ICL Commands" in "Output.i6t".
The third noun is an object that varies.
The third noun variable translates into I6 as "third".
Include(-
[ ThirdNoun x;
x = ParseToken(ELEMENTARY_TT, NOUN_TOKEN);
if (x == GPR_FAIL or GPR_REPARSE) return x;
third = x; return GPR_PREPOSITION;
];
-).
The Understand token third-noun translates into I6 as "ThirdNoun".
Combining it with is an action applying to two things.
Understand "combine [something] with [something] with [third-noun]" as combining it with.
Report combining it with:
say "Combined [the noun] with [the second noun] with [the third noun]."
Test me with "combine rock with stone with pebble".
Note that the action is defined as “applying to two things”. I7 doesn’t understand that there’s a third noun, so you have to write it that way.
Of course, the third noun variable won’t be wrapped up into stored actions or reset between turns the way noun and second noun are. You’ll have to be careful with it.