Assignment 10:

If you are looking for a Python online tutor or want someone to help with Python homework then we can deliver a solution.

You will get to explore loops and conditionals in this assignment, based on a simple adventure game.
You play an adventurer exploring an unknown castle in search of the treasures contained inside, but
BEWARE danger awaits.

You start at the entrance of the castle and then asked which room your would like to visit. As you
visit the room, a description of the room is displayed and the contents is displayed, and the game
ends when the exit is chosen. This game also ends if you find the treaure, or the player dies.

1. There should be a minimum of 6 rooms, one of which contains the treasure.
2. Some rooms can be only visited from other rooms.

There is a random chance of 2% if dieing, then can be done by selecting a random number from the
range(0, 100) and if it > 98 then you die. You need to import random to at the top of the program.

Do you require help with Python assignment, if so please consider using our service, we guarantee results or a full refund if we can’t deliver.

```# Halloween Adventure Game

import random
enter= input(" Welcome to the Chloe's Haunted Castle, you must be careful here. \n There is trasure here for you to find from when Chloe died 78 years ago.\n But each room you enter your chances of living decease, this place isn't safe. \n If at any time during the game you want leave type leave type (leave) \n Are you sure you would like to enter? Yes (Y) or No (N)?: ")
if enter == 'Y'or enter == 'y':
game = True
# This is where the game starts
while (game == True):
if dead > 98:
print(" \n You tried to run? You're dead now. Goodbye. ")
game = False
print(" \n As you walk through the corridors you feel a cold breeze come upon you. \n you see two doors and a knights armour in the corner. ")
kitchen = False
armour = False
while kitchen == False:
choice1 = input(" Would you like to walk through a door (d) or look at the knights armour (a)? ")
if choice1 == 'd'or choice1 == 'D':
print("\n The door on the right is locked, the door on the left is open, \n as you enter through the left door you see a brewing pot and skeletons. \n The pot is still hot, someone must have just left, or maybe not left. \n Maybe there is someone still here... ")
if dead > 98:
print("\n You walk closer to the pot and someone comes from behind you and pushes you in! \n You are now dead.")
game = False
kitchen = True
choice3 = input(" This looks like a kitchen.\n Since there is a pot maybe a Witch lives here. \n Would she know where the treasure is? \n Do you want to look around for clues (C) or go into the next room (N)?: ")
if choice3 == 'c' or choice3 == 'C':
print("\n You find a map of the Castle by the boiling pot. \n From the map you can tell where you are and how many rooms are around you.")
choice3 = input(" Lets go to a new room, the map shows a family room (F) and dining room (D), which would you like to enter?: ")
if choice3 == "N" or choice3 == 'n':
choice3 = input(" There is a family room (F) and dining room (D), which would you like to enter?: ")
if choice3 == 'f' or choice3 == 'F':
print("\n You are now in the family room. you see a oil painted portrait hanging over the fire place. \n There are cob webs on all of the furniture. \n It must have been a long time since someone was here: ")
input("\n Do you want to search the room for the treasure (T)? Or walk to the next room (N)?: ")
if dead > 98:
print("\n Someone jumps out of a painting and kills you.\n You are dead. \n Goodbye.")
game = False
if choice3 == 'd' or choice3 =='F':
print("\n You are now in the dining room.")
if dead > 98:
print("\n Before you left the kitchen you tried the Witches brew. \n It was poision you are dead now. \n Goodbye.")
game = False
elif choice1 == 'a' or choice1 == 'A':
print("\n The armour is heavy, you try to lift the helmet to see if anyone is inside, \n but before you do you hear a scream from the left door.")
choice2 = input(" Do you want to investigate the scream (I)? Or try and get the armour (A)?: ")
if choice2 == 'I' or choice2 == 'i':
print("\n You enter the next room. \n It looks like a Witches kitchen. You see bones on the ground and a brew pot. \n The pot is still hot. Is anyone here? ")
if dead > 98:
print("\n You slipped on a rat and cracked your head, your are dead. \n Goodbye.")
game = False
choice3 = input(" This looks like a kitchen.\n Since there is a pot maybe a Witch lives here. \n Would she know where the treasure is? \n Do you want to look around for clues (C) or go into the next room (N)?: ")
if choice3 == 'c' or choice3 == 'C':
print("\n You find a map of the Castle by the boiling pot. \n From the map you can tell where you are and how many rooms are around you.")
choice3 = input(" Lets go to a new room, the map shows a family room (F) and dining room (D), which would you like to enter?: ")
if choice3 == "N" or choice3 == 'n':
choice3 = input(" There is a family room (F) and dining room (D), which would you like to enter?: ")
if choice3 == 'f' or choice3 == 'F':
print("\n You are now in the family room. you see a oil painted portrait hanging over the fire place. \n There are cob webs on all of the furniture. \n It must have been a long time since someone was here: ")
input("\n Do you want to search the room for the treasure (T)? Or walk to the next room ")
if dead > 98:
print("\n Someone jumps out of a painting and kills you.\n You are dead. \n Goodbye.")
game = False
if choice3 == 'd' or choice3 =='F':
print("\n You are now in the dining room.")
if dead > 98:
print("\n Before you left the kitchen you tried the Witches brew. \n It was poision you are dead now. \n Goodbye.")
game = False
kitchen = True
if choice2 == 'A' or choice2 == 'a':
print("\n You found a way to get the helmet off of the suit. \n as soon as you remove it red liquid gushes out of the armour. \n You freeze and drop the helmet. What could this liquid be? \n Please don't be blood, do you think we should leave?" )
elif choice2 == 'leave' or choice2 == 'Leave':
print("\n You have exited the Castle.")
game = False
kitchen = True
elif choice1 == 'leave' or choice1 == 'Leave':
print("\n You have exited the Castle.")
game = False
kitchen = True
elif enter == 'N' or enter == 'n':
print("\n Wise choice, you will be safer out here....")

elif enter == 'Leave' or enter == 'leave':
print("\n You have exited the Castle.")

else:
print("\n I'm sorry I dont understand your choice, type Y for yes, and N for no. ")

# print(" The door is now open, as you enter you feel a cold breeze. \n Do you see anything that looks dangerous? \n There is a knight's armour in the back corner,n\ do you want to take a closer look at it? (Y) or (N): ")```

The following Python homework, is an example Python homework which demonstrates a possible solution, we’ve done as many as six versions of the same assignment and each was totally different (not just the variable names, and functions but the algorithms used, and the type of constructs).

## Solution:

```# Halloween Adventure Game

import random

def play_game():

have_map = False
enter = input(" Welcome to the Chloe's Haunted Castle, you must be careful here. \n There is trasure here for you to find from when Chloe died 78 years ago.\n But each room you enter your chances of living decease, this place isn't safe. \n If at any time during the game you want leave type leave type (leave) \n Are you sure you would like to enter? Yes (Y) or No (N)?: ")
if enter.lower() == 'y':
# This is where the game starts
if dead > 98:
print(" \n You tried to run? You're dead now. Goodbye. ")
return
print(" \n As you walk through the corridors you feel a cold breeze come upon you. \n you see two doors and a knights armour in the corner. ")

choice1 = input(" Would you like to walk through a door (d) or look at the knights armour (a)? ")
if choice1.lower() == 'leave':
print("\n You have exited the Castle.")
return
elif choice1.lower() == 'd':
print("\n The door on the right is locked, the door on the left is open, \n as you enter through the left door you see a brewing pot and skeletons. \n The pot is still hot, someone must have just left, or maybe not left. \n Maybe there is someone still here... ")
if dead > 98:
print("\n You walk closer to the pot and someone comes from behind you and pushes you in! \n You are now dead.")
return
choice3 = input(" This looks like a kitchen.\n Since there is a pot maybe a Witch lives here. \n Would she know where the treasure is? \n Do you want to look around for clues (C) or go into the next room (N)?: ")
if choice3.lower() == 'leave':
print("\n You have exited the Castle.")
return
elif choice3.lower() == 'c':
have_map = True
print("\n You find a map of the Castle by the boiling pot. \n From the map you can tell where you are and how many rooms are around you.")
choice4 = input(" Lets go to a new room, the map shows a family room (F) and dining room (D), which would you like to enter?: ")
elif choice3.lower() == 'n':
choice4 = input(" \nThere is a family room (F) and dining room (D), which would you like to enter?: ")

if choice4.lower() == 'leave':
print("\n You have exited the Castle.")
return
elif choice4.lower() == 'f':
print("\n You are now in the family room. you see a oil painted portrait hanging over the fire place. \n There are cob webs on all of the furniture. \n It must have been a long time since someone was here: ")
if dead > 98:
print("\n Someone jumps out of a painting and kills you.\n You are dead. \n Goodbye.")
return
choice5 = input("\n Do you want to search the room for the treasure (T)? Or walk to the next room (N)?: ")
if choice5.lower() == 'leave':
print("\n You have exited the Castle.")
return
elif choice5.lower() == 'n':
print("\n You got trapped in the room. The door is locked behind you!")
if have_map:
print("Fortunately you see the secret passage out of this place on your map. You managed to get back into the family room")
choice5 = 't'
else:
print("You are goind to die here.\n No luck today")
return
elif choice5.lower() == 't':
choice6 = input("You start looing around but it is too dark there.\n Do you want to light a candle (L) or keep looking (K): ")
if choice6.lower() == 'leave':
print("\n You have exited the Castle.")
return
elif choice6.lower() == 'l':
print(' \nYou lit a candle and see a monstrous face in front of you.\n You are scared to death.')
return
elif choice6.lower() == 'k':
print(" \nYou do not dare to get a candle out of your backpack. \n Yet, after a minute of searching you stumbled upon a big wooden chest.")
print(" You try to open it but the lid is too heavy... You pull harder and see a lot of gold inide.")
print(" You take as much as you can and hurry out of this place")
return
elif choice4.lower() == 'd':
print("\n You are now in the dining room.")
if dead > 98:
print("\n You try some food from the table. \n It was poision you are dead now. \n Goodbye.")
return
print("You don't see anything interesing there. Yet, you can spot two more doors.")
choice7 = input("Do open the door on the right (R) or on the left (L)?: ")
if choice7.lower() == 'leave':
print("\n You have exited the Castle.")
return
elif choice7.lower() == 'l':
if dead > 98:
print("\n Someone jumps out of the ceil and kills you.\n You are dead. \n Goodbye.")
return
print(" \nYou see a fire burning in the center of the room")
print(" As you approach closer you can see golden helmet on the table and a couple of silver coins.")
print(" You quickly grap everything and run away. You never returned to this place. Never...")
return
elif choice7.lower() == 'r':
if dead > 98:
print("\n You broke your leg and cannot walk.\n You slowly die here. \n Goodbye.")
return
print(" \nYou open a door and see a small room with human faces on the wall...")
print(" You've had enough of it!")
print(" You are too scared to keep going and exit the Castle.")
return

elif choice1.lower() == 'a':
print("\n The armour is heavy, you try to lift the helmet to see if anyone is inside, \n but before you do you hear a scream from the left door.")
choice2 = input(" Do you want to investigate the scream (I)? Or try and get the armour (A)?: ")
if choice2.lower() == 'leave':
print("\n You have exited the Castle.")
return
if choice2.lower() == 'a':
print("\n You found a way to get the helmet off of the suit. \n as soon as you remove it red liquid gushes out of the armour.\n You freeze and drop the helmet. What could this liquid be? \n Please don't be blood, do you think we should leave?")
if dead > 98:
print("\n You are frightened. Too frightened.. You've got a heart attack \n You die.")
return
print("You have no other choice but to open the next door.")
choice2 = 'i'
if choice2.lower() == 'i':
print("\n You enter the next room. \n It looks like a Witches bedroom.  Is anyone here? ")
print(" You slowly come closer to the pot and see the witch sleeping")
choice3 =  input(" Do you want to wake (W) her or keep going (K): ")
if choice3.lower() == 'leave':
print("\n You have exited the Castle.")
return
elif choice3.lower() == 'w':
print(" \nYou touch the witch by the shoulder and she wakes up ...")
print(" She is a good witch. She smiles and gives you a golden ring with a huge diamond.")
print(" You happily leave the Castle")
elif choice3.lower() == 'k':
print(" \nYou crawl past the witch and walk out of the bedroom. \n It is very very dark here.")
print(" You can spot a small dor in the far corner of the room")
choice4 = input("Do you want to open the door (O) or go back (B): ")
if choice4.lower() == 'leave':
print("\n You have exited the Castle.")
return
elif choice4.lower() == 'o':
print(" \nYou push the door and get into a long and dark passage. \n At it's far end you stumble upon a deep well with spiraling staricase.\n You decide to climb down... ")
print("At the very bottom you found a pile of human bones. \n When you inspect the bottom closer you found a box full of diamonds!")
print("Now you need to get safely out of there..")
elif choice4.lower() == 'b':
print(" \nYou start backing past the witch's bed and suddenly you get tangled in chains lying on the floor.")
print(" The witch wakes up angry and takes you to her kitchen")
print(" You realize with terror that you will be a part of her dinner. You die")
elif enter.lower() == 'n':
print("\n Wise choice, you will be safer out here....")
elif enter.lower() == 'leave':
print("\n You have exited the Castle.")
else:
print("\n I'm sorry I dont understand your choice, type Y for yes, and N for no.")

play_game()
# print(" The door is now open, as you enter you feel a cold breeze. \n Do you see anything that looks dangerous? \n There is a knight's armour in the back corner,n\ do you want to take a closer look at it? (Y) or (N): ")```

## Index:

So if you decide that you require help with Python homework then I’m sure we can deliver.