New code: Initializing the bats

# Initialize Bats.
NUMBATS = 2
for bat in range(NUMBATS):
    room = random.choice(cave_system.rooms)
    # Now check if we have already put a bat in this room,
    while room.has_bat():
        # and if we have pick another room.
        room = random.choice(cave_system.rooms)
    room.bat = Bat(room.number)

You'll notice there's some new code to initialize the bats. Its job is to place two bats in two different randomly chosen rooms. It does this by choosing a room at random and checking to see if there is already a bat in it. If there is, it chooses another and keeps on doing so until it finds a room unoccupied by a bat. Once it has a room without a bat, it creates a bat and places it there.

Notes:

room = cave_system.rooms[random.randint(0, len(cave_system.rooms) - 1)]