old dogs new tricks ÿÿÿÿ


Sat, 10 Jun 95 07:51:00 -0500

Much thanks to all the creative solutions to the extended lighting tricks.
So many very different answers... You know it strikes me, once again, that
there sure seems to be a lot of you out there with quite extensive Inform
programming knowledge... why isn't aren't there more inform games out there?!

Okay, enough with paradox.

I think the way I'm going to code the lighting thing is a sort of variation
on the suggestion of creating two new attributes (one for each lamp) and
assigning the particular lamp attribute to each room that is lighted by that
lamp... then in the Each_turn routine check if it has one of the lamp
attributes and if so, if it is on, then light it....

I think that was probably simplest solution, however I think I can make it
even simpler, and not have to use up any precious attributes! (-;

If I define a class (of room) for each lamp which, in a Each_turn routine,
checks if the switch for the lamp for that class (the switch only exists
in one room) is on, and grants light according to the 'on' attribute.

This is untested as of, but I think it should work, because the For_Each
property is additive. Therefore for rooms with overlaping light sources Can
easily be defined as belonging to two (or more) classes--and each For_Each
routine will be called one after the other to check the respective lamp
switches, and grant lovely light accordingly.

Not bad, eh!

I have a new problem I can't quite figure out though! I'll post it in
another message to keep these problems seperate... thanks again for
everyone's ideas. Possibly there are more coming as well... news is very
slow here.

---
  ...with love and tomato sandwiches.      <as544@torfree.net>