I’m trying to do some simple programming as part of an inform story, but I’m rather new to this particular language.
The following example comes from the Inform7 documentation and I can’t get it to work.
While I won’t be using this example exactly, I will be needing to do something similar with the user passing in the loop parameters.
Can someone help me by adding any other lines required to get it to work as a bare-bones example?
I tend to learn best by seeing how others have tackled something.
To plot a grid with size (S - a number):
repeat with x running from 1 to S:
say "Row [x]: ";
repeat with y running from 1 to S:
say " [y] ";
say "."
When play begins, plot a grid with size 5.
Home is a room.
Aha. Your problem is that ‘plot a grid with size 5’ in that example is an instruction for a code function, not an instruction for what to do with the player’s commands. If the latter is what you want, you need to create (or modify) an action.