Skip to content

Commit

Permalink
fix: leave one space between question and user input (it was too clut…
Browse files Browse the repository at this point in the history
…tered).
  • Loading branch information
KanielPinto committed Mar 8, 2023
1 parent 6796e0c commit ea358ab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Binary file modified __pycache__/chapters.cpython-310.pyc
Binary file not shown.
24 changes: 12 additions & 12 deletions chapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def start():
def chapter_river():
answer = input(Fore.GREEN +
"You come to a river, you can walk around it or swim accross."
"Type walk to walk around & swim to swim across." + Fore.LIGHTMAGENTA_EX).lower()
"Type walk to walk around & swim to swim across. " + Fore.LIGHTMAGENTA_EX).lower()
# if user inputs swim then
if answer == "swim":
game_over(Fore.RED + "You swam across the river and were eaten by an aligator \U0001F480")
Expand All @@ -26,7 +26,7 @@ def chapter_river():
answer = input(Fore.GREEN +
"You walked for many miles, ran out of water and remembered "
"that there was a shop far away (10 miles/16kms) which supplies water."
"Do you want to go there (yes/no)?" + Fore.LIGHTMAGENTA_EX).lower()
"Do you want to go there (yes/no)? " + Fore.LIGHTMAGENTA_EX).lower()
# if user inputs no then
if answer == "no":
game_over(Fore.RED + "You were very de-hydrated and died of thirst when you were walking. \U0001F480")
Expand All @@ -35,11 +35,11 @@ def chapter_river():
elif answer == "yes":
# q3
answer = input(Fore.GREEN +
"You are thirsty, do you want to drink some water (yes/no)?" + Fore.LIGHTMAGENTA_EX).lower()
"You are thirsty, do you want to drink some water (yes/no)? " + Fore.LIGHTMAGENTA_EX).lower()
# if user inputs yes then
if answer == "yes":
print(Fore.GREEN +
"You went 10 miles walking and bought 10 liters of drinking water"
"You went 10 miles walking and bought 10 liters of drinking water. "
)
# if user inputs no then
elif answer == "no":
Expand All @@ -49,7 +49,7 @@ def chapter_river():
game_over()
# q4
answer = input(Fore.GREEN +
"You drank 5 liters of water and now you feel refreshed. Do you want to walk further or go back home? (further/home)" + Fore.LIGHTMAGENTA_EX).lower(
"You drank 5 liters of water and now you feel refreshed. Do you want to walk further or go back home? (further/home) " + Fore.LIGHTMAGENTA_EX).lower(
)
# if user inputs further then
if answer == "further":
Expand All @@ -64,12 +64,12 @@ def chapter_river():

def chapter_bridge():
answer = input(Fore.GREEN + "You come to a bridge, it looks wobbly,"
"do you want it or do you want to head back? (cross/back)" + Fore.LIGHTMAGENTA_EX).lower()
"do you want it or do you want to head back? (cross/back) " + Fore.LIGHTMAGENTA_EX).lower()
# if user inputs back then
if answer == "back":
answer = input(Fore.GREEN +
"You go back to the main road."
"Now you can decide to drive forward or turn left. (forward/left)" + Fore.LIGHTMAGENTA_EX).lower()
"Now you can decide to drive forward or turn left. (forward/left) " + Fore.LIGHTMAGENTA_EX).lower()
if answer == "forward":
game_over(Fore.RED + "You drive forward and crash into a tree and die.\U0001F480 ")
# if users inputs left then
Expand All @@ -84,14 +84,14 @@ def chapter_bridge():

def chapter_lake():
answer = input(Fore.GREEN + "You turned left and you come to a lake,"
"do you want to swim or go back? (swim/back)" + Fore.LIGHTMAGENTA_EX).lower()
"do you want to swim or go back? (swim/back) " + Fore.LIGHTMAGENTA_EX).lower()
if answer == "swim":
game_over(Fore.RED + "You swam accross the lake and were eaten by a shark. \U0001F480 ")

elif answer == "back":
answer = input(Fore.GREEN +
"You go back to the main road."
"Now you can decide to drive forward or turn left. (forward/left" + Fore.LIGHTMAGENTA_EX).lower()
"Now you can decide to drive forward or turn left. (forward/left " + Fore.LIGHTMAGENTA_EX).lower()
if answer == "forward":
game_over(Fore.RED + "You drive forward and crash into a tree and die. \U0001F480")
elif answer == "left":
Expand All @@ -102,11 +102,11 @@ def chapter_lake():

def chapter_stranger():
answer = input(Fore.GREEN +
"You cross the bridge and meet a stranger, do you talk to them? (y/n)" + Fore.LIGHTMAGENTA_EX).lower()
"You cross the bridge and meet a stranger, do you talk to them? (y/n) " + Fore.LIGHTMAGENTA_EX).lower()
if answer == "y":
answer = input(Fore.GREEN +
"You talk a wizard and they ask you,"
"do you want to be a wizard? (y/n)")
"do you want to be a wizard? (y/n) " + Fore.LIGHTMAGENTA_EX).lower()
if answer == "y":
game_over(Fore.RED + "You are a wizard and you WIN the game! \U0001f3c6", win=True)
elif answer == "n":
Expand All @@ -122,7 +122,7 @@ def game_over(message: str = None, *, end_game=True, win=False):
else:
print(Fore.BLUE + "Game over")
print(Fore.LIGHTYELLOW_EX + "Thanks for playing!")
answer = input(Fore.GREEN + "Do you want to play again? (y/n)" + Fore.LIGHTMAGENTA_EX).lower()
answer = input(Fore.GREEN + "Do you want to play again? (y/n) " + Fore.LIGHTMAGENTA_EX).lower()
if answer == "y":
start()
elif answer == "n":
Expand Down

0 comments on commit ea358ab

Please sign in to comment.