1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
4vir4ik [10]
2 years ago
16

Can someone tell me why this keeps exiting no matter what move and how I can fix it I honestly hate this class... you guys can h

ave 100 points
#Andrew
#IT140
#ModuleSixMilestone
rooms = {'Manor Entrance': {'South': 'Foyer'},
'Foyer': {'North': 'Manor Entrance', 'West': 'Cellar'},
'Cellar': {'East': 'Foyer'},
'Exit': {'Exit': 'Exit'}} # The dictionary links a room to other rooms.

currentRoom = 'Manor Entrance' # Start the player in the Manor Entrance.


print('Move commands: North, South, East, West, Exit.')
print(' ------------------- ')
print('You are in the Manor Entrance.')
print('Enter your move or exit the game. -> ')
# User input a command to either move to another room or exit the game.
# If the player enters "exit", the game should move them to the "exit" room.
moveCommands = ['North', 'South, ''East', 'West', 'Exit']
command = input()

# Gameplay loop for moving to different rooms.

if currentRoom == rooms['Manor Entrance']:
if command == 'Exit': # If the player enters "exit", the game should move them to the "exit" room.
print('The virus will destroy the world now that you have quit.')
elif command == 'South':
print('You entered the Foyer!')
print(currentRoom[1])
elif command <= 'South':
print('Error. Try again!') # Print an error message if the player enters an invalid direction.

if currentRoom == rooms['Foyer']:
if command == 'Exit': # If the player enters "exit", the game should move them to the "exit" room.
print('The virus will destroy the world now that you have quit.')
elif command == 'West':
print('You entered the Cellar!')
print(currentRoom[2])
elif command <= 'West':
print('Error. Try again!') # Print an error message if the player enters an invalid direction.

if currentRoom == rooms['Cellar']:
print('You win! You have made it to the Cellar and destroyed the Nemesis!')
if command == 'Exit': # If the player enters "exit", the game should move them to the "exit" room.
print('You have eradicated the Virus.')
Computers and Technology
1 answer:
velikii [3]2 years ago
7 0

Answer:

Something like this?

The only requirement this doesn't exactly hit is moving the user to the "exit" room. It doesn't make use of that entry in the dictionary. However, this is the best way of doing it to avoid multiple "if" statements.

You might be interested in
I want to know all the part of computer system
Effectus [21]
There are alot of parts in a computer system. You have to be a little specific
4 0
3 years ago
I will give Brainliest to the best answer, I need urgent HELP
laila [671]
The answer is B. Range
4 0
3 years ago
2. A computer is using a fully associative cache and has 216 bytes of memory and a cache of 64 blocks, where each block contains
Irina-Kira [14]

Answer:

2048 blocks

Explanation:

From the information given:

The memory size of a computer with fully associative cache = 2¹⁶ bytes

The no. of blocks in a single cache = 64

In which each block size = 32 bytes

The no of blocks in the main memory = memory size ÷ block size

The no of blocks in the main memory = 2¹⁶ ÷ 32

The no of blocks in the main memory = 2¹⁶ ÷  2⁵

The no of blocks in the main memory = 2^{16-5}

The no of blocks in the main memory = 2¹¹

The no of blocks in the main memory = 2048 blocks

4 0
3 years ago
The program below is used to calcualte the sum of 3 numbers. There is an error in this program. Which line contains the error? n
djyliett [7]

Answer:

  1. num1=10
  2. num2 =20
  3. num3="30"
  4. sum = num1+num2+num3
  5. print (num1)
  6. print (num2)
  7. print (num3)
  8. print (sum)

The error is at line 3. The variable num3 has been assigned a string value with use of the quotes.

To fix the error, take away the quotes from the number 30, since the arithemetic operation cannot be carried out on the string in python program language.

Explanation:

5 0
3 years ago
How to creatte a react app without a git hub repository
Sunny_sXe [5.5K]

Answer:

You needn't be on Github. You just need to have the software, like visual code installed on your computer.

If you've got all these things sorted, then you'll be able to make apps without github.

6 0
3 years ago
Other questions:
  • What is the main type of energy used to help convert metamorphic rocks into igneous rocks in the rock cycle ?
    10·1 answer
  • With ____________________, you can insert and remove a device while the computer is running.
    11·1 answer
  • You have been having issues with your printer, so you decide to learn more about how the printer works. You learn that if you re
    12·1 answer
  • Write a program that computes the minimum, maximum, average and standard deviation of the population over time for a borough (en
    6·1 answer
  • Write a function called word_count that takes a string and returns a dictionary that maps every case-insensitive word in the str
    6·1 answer
  • Final one bit l y links are a virus that will corrupt your files do not go on it
    15·2 answers
  • I don't want my large video files using up all my hard drive space . Can I archive my videos in on DVDs or Blu Rays?
    8·1 answer
  • Debug the program so it prints the factorial of a positive integer entered by the user. This is calculated by multiplying all th
    9·1 answer
  • Which graphic file format would you choose if you needed to make an animated graphic for a website?
    5·1 answer
  • a good way to repeatedly perform an operation is to write the statements for the task once and then place the statements in a lo
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!