using loops

i am trying to make "night’ with a loop but not sure how the code works, here is what I have so far:

nighttime is a region. the park, the huge blue tree, the tunnel, the fort and the cavern are in nighttime.

After entering the park:
repeat with R running through rooms in the nighttime Area:
now R is not lit;
continue the action.

Your code looks pretty close to right, but you may be having problems with how it’s tabbed.

There are two different styles that you can use to lay out arguments in I7. The one you’re using - which is the one used by default in the manual - requires precise use of tabs. So you may have an extra tab or a tab missing in there somewhere.

(If you use the code tag, you can post code on the forum without it destroying the tabs. That’d make the problem easier to diagnose.)

There’s a different style in which you open and close each part of the code explicitly, and tabs don’t make any difference. See 11.7: Begin and end.

Two more things:

You should just say “nighttime” rather than “nighttime area”; Inform won’t recognize the latter as the region you’ve defined.

You need to say “After going to the park” rather than “after entering the park.” The entering action is the sort of thing that you would do to get into an enterable container or onto an enterable supporter, like a box, bench, or chair. Moving from room to room is “going.”

(Also, the way this goes, you’ll get a description of the park as if it were lighted and then the lights will go out. If you want this rule to preempt the normal description of the park, make it “Carry out going to the park”; then it’ll run before the rule that prints the description of the room you’ve gone into.)

thank you, you’re second comment fixed everything!


after going to the park: now every room in nighttime is not lit.