Skip to main content
2 of 4
added 912 characters in body
Spikatrix
  • 1k
  • 1
  • 9
  • 21

Bug

I ran your game and here is the output:

$ python3 test.py
Welcome to Camel!
You have stolen a camel to make your way across the great Mobi desert.
The natives want their camel back and are chasing you down! Survive your desert trek and out run the natives.


    A. Drink from your canteen.
    B. Ahead at moderate speed.
    C. Ahead full speed.
    D. Stop for the night.
    E. Status check
    Q. Quit.

Your choice? D
Your camel feels refreshed and happy his fatigue is now  0
Traceback (most recent call last):
  File "test.py", line 73, in <module>
    if oasis == 20:
NameError: name 'oasis' is not defined

If I select any option other than C and D, I get the NameError. You can fix it by adding

oasis = 0

before the while loop.

Suggestions

  1. This

    print("Welcome to Camel!")
    print("""You have stolen a camel to make your way across the great Mobi desert.
    The natives want their camel back and are chasing you down! Survive your desert trek and out run the natives.""")
    print()
    

    can be written as

    print("Welcome to Camel!")
    print("""You have stolen a camel to make your way across the great Mobi desert.
    The natives want their camel back and are chasing you down! Survive your desert trek and out run the natives.\n""")
    

    Similarly,

    print("""
    A. Drink from your canteen.
    B. Ahead at moderate speed.
    C. Ahead full speed.
    D. Stop for the night.
    E. Status check
    Q. Quit.""")
    print()
    

    can be written as

    print("""
    A. Drink from your canteen.
    B. Ahead at moderate speed.
    C. Ahead full speed.
    D. Stop for the night.
    E. Status check
    Q. Quit.\n""")
    

    thereby eliminating the need for a seperate print().

  2. You can eliminate the need for a Done variable by using an infinite loop

    while True:
    

    and replacing every Done = True with break. This will also eliminate the need for using and not done in some of the conditions.

  3. Instead of doing stuff like

    camelFatigue *= 0
    thirst *= 0
    

    You can use

    camelFatigue = thirst = 0
    
  4. You have

    if userInput.lower() == "q":
        # ...
    elif userInput.lower() == "e":
        # ...
    elif userInput.lower() == "d":
        # ...
    elif userInput.lower() == "c":
        # ...
    elif userInput.lower() == "b":
        # ...
    elif userInput.lower() == "a":
        # ...
    

    You should also have an else printing an error message in case the user enters something invalid. Like so:

    if userInput.lower() == "q":
        # ...
    elif userInput.lower() == "e":
        # ...
    elif userInput.lower() == "d":
        # ...
    elif userInput.lower() == "c":
        # ...
    elif userInput.lower() == "b":
        # ...
    elif userInput.lower() == "a":
        # ...
    else:
        print("Invalid input; Try again") # Print error message
    
Spikatrix
  • 1k
  • 1
  • 9
  • 21