intficpy/room.py
def describeDark(self, game):
        """
        If this Room is currently dark, describe the darkness. If the Room
        is lit by a LightSource, describe how the LightSource lights the
        Room.

        Return True if the player will be unable to see anything but darkness,
        and False otherwise.

        :param game: the current game
        :type game: IFPGame
        :rtype: bool
        """
        if not self.dark:
            return False

        lightsource = (
            (
                [
                    item
                    for key, sublist in self.contains.items()
                    for item in sublist
                    if getattr(item, "is_lit", False)
                ]
                + [
                    item
                    for key, sublist in game.me.contains.items()
                    for item in sublist
                    if getattr(item, "is_lit", False)
                ]
            )
            or [None]
        )[0]

        if lightsource:
            game.addTextToEvent("turn", lightsource.room_lit_msg)
            return False

        game.addTextToEvent("turn", self.dark_desc)
        return True

        If this Room is currently dark, describe the darkness. If the Room
        is lit by a LightSource, describe how the LightSource lights the
        Room.

        Return True if the player will be unable to see anything but darkness,
        and False otherwise.

        :param game: the current game
        :type game: IFPGame
        :rtype: bool
        
If this Room is currently dark, describe the darkness. If the Room
is lit by a LightSource, describe how the LightSource lights the
Room.

Return True if the player will be unable to see anything but darkness,
and False otherwise.
If this Room is currently dark describe the darkness . If the Room is lit by a LightSource describe how the LightSource lights the Room . Return True if the player will be unable to see anything but darkness and False otherwise .
def describeDark(self, game):
        if not self.dark:
            return False
        lightsource = (
            (
                [
                    item
                    for key, sublist in self.contains.items()
                    for item in sublist
                    if getattr(item, "is_lit", False)
                ]
                + [
                    item
                    for key, sublist in game.me.contains.items()
                    for item in sublist
                    if getattr(item, "is_lit", False)
                ]
            )
            or [None]
        )[0]
        if lightsource:
            game.addTextToEvent("turn", lightsource.room_lit_msg)
            return False
        game.addTextToEvent("turn", self.dark_desc)
        return True
def describeDark ( self , game ) : if not self . dark : return False lightsource = ( ( [ item for key , sublist in self . contains . items ( ) for item in sublist if getattr ( item , "is_lit" , False ) ] + [ item for key , sublist in game . me . contains . items ( ) for item in sublist if getattr ( item , "is_lit" , False ) ] ) or [ None ] ) [ 0 ] if lightsource : game . addTextToEvent ( "turn" , lightsource . room_lit_msg ) return False game . addTextToEvent ( "turn" , self . dark_desc ) return True
If this Room is currently dark, describe the darkness.
If this Room is currently dark describe the darkness .
"""
        If this Room is currently dark, describe the darkness. If the Room
        is lit by a LightSource, describe how the LightSource lights the
        Room.

        Return True if the player will be unable to see anything but darkness,
        and False otherwise.

        :param game: the current game
        :type game: IFPGame
        :rtype: bool
        """
None
bool
self
game
the current game
the current game