You are a wizard. You are walking through the woods when, magically, you find yourself inside a fire-breathing dragon’s lair. You know that dragons hoard gold, and you realize that this is your opportunity to recover all the gold that has been mysteriously vanishing from the townspeople that live nearby. Your goal is to find the gold, and return it to its rightful owners. The only item of use that you have with you is your wand, which you may need to use to kill the dragon. Unfortunately, dragons take a lot of magic to kill, and your wand only has enough magic in it to cast five “dragon-kill” spells. The dragon’s lair consists of 20 rooms; each room connects to exactly three other rooms. Two of the rooms have bottomless pits in them. If you enter one of these rooms, you will immediately fall to your death. Two rooms have bats in them. If you enter one of these rooms, the bats will pick you up, fly you to a random room in the lair, and then drop you off in that room. Then the bats fly to a different random room and wait for you to find them again. One room has a pile of gold. If you enter this room, you restore all the gold to the townspeople, they are happy, and you win the game. The dragon roams about his lair by moving through adjacent rooms, and therefore can be in any room. A quarter of the time, he is too lazy to move from one room to the next. The dragon has wings, so he can be in the rooms with the bottomless pits without dying. It is too heavy for the bats to pick the dragon up and fly with him. Therefore, the bats do not affect the dragon. Other than the dragon’s fire, which will kill you, there is no light in the lair, so you cannot see what is in rooms adjacent to your current room. However, you can feel a draft when you are in a room that is adjacent to a bottomless pit. Also, you can hear wings flapping when you are in a room that is adjacent to bats. You can smell smoke if you are in a room adjacent to the dragon. In these cases, proceed with caution. . .your life may be at risk! If you enter the room where the dragon is, you have three options: run, cast a spell, or hide. If you choose to run, you will randomly run into one of the three adjacent rooms. If you choose to cast a spell, you have a 50% chance of the spell striking the dragon. (Sometimes, your aim is off; sometimes, the dragon moves out of the path of the spell before it reaches him.) If you actually hit the dragon, the spell will be 100% effective and it will kill the dragon. However, if you miss, the dragon will detect your location based on the origin of the spell, breathe fire on you, and kill you. If you choose to hide, you will hide behind a large boulder in the room. Half the time, the room is too full of smoke for the dragon to be able to find you once you’ve hidden, so he gives up and wanders into an adjacent room. Of course, you can’t see which room he entered due to the thick smoke. If the dragon finds you, he will breathe fire on you, and kill you.
this was made for school.