On the other hand, I was tempted to add the darkness code to the predefined Location class, but reconsidered for two reasons. First, few or no rooms in any game will ever need to be darkened, so the respective checks will be a useless overhead most of the time. Second, having a distinct DarkRoom class means you can bypass it entirely and roll your own mechanism if you want. Especially as I went with a primitive implementation which doesn't consider portable light sources. (Nor is such a thing defined in the library.)


every darkroom isa location
 is dark.
 check this is not dark
     else "It's too dark to see much."
   verb examine
     check this is not dark
       else "It's too dark to get a good look."
   end verb.
end every.

What They Say

"[the game] does not represent the real capabilities of the Alan Language but does demonstrate Alan's amazing ability to allow someone who has never done an iota of computer programming of any kind to produce SOMETHING within a few weeks!"

Eric Mayer (on his game HeBGB Horrors)