It is possible to use a ZZT-OOP code to check for if a place is dark. The draw procedure for stars will change their colours, so you can check if something is visible (either because the room is not dark, or because it is in the range of the torch light), by throwing a star and then to change into something else and check their colours, if it was obscured by the dark then it will be white, otherwise not.