Refactor all the lines with a length >80 characters

This commit is contained in:
Andreas Zweili 2016-11-12 19:39:03 +01:00
parent 974a8d36f7
commit d9ad9ab479
2 changed files with 21 additions and 9 deletions

View File

@ -28,7 +28,7 @@ def pet_stats():
print("Age: " + str(pet_variables.pet_age))
print("Health: " + pet_variables.pet_health * "")
print("Hunger: " + pet_variables.pet_hunger * "*")
print("Happines: " + pet_variables.pet_happiness * "")
print("Happines: " + pet_variables.pet_happiness * " ")
# A function which checks if the pet is still alive
@ -83,13 +83,16 @@ def aging():
if pet_variables.pet_age == 5:
pet_variables.pet_status = "adult"
set_adult_stats()
print("Congratulation your pet has become an adult. It needs less food now")
print("and it's health has improved however it's grumpier than a youngling.")
print("Congratulation your pet has become an adult. \
It needs less food now")
print("and it's health has improved. However, \
it's grumpier than a youngling.")
elif pet_variables.pet_age == 15:
pet_variables.pet_status = "elderly"
set_elderly_stats()
print("Congratulation your pet has become an elderly it needs now less food.")
print("However it's health is worse and it's grumpier than an adult.")
print("Congratulation your pet has become an elderly. \
It needs less food now.")
print("However it's health is worse and it is grumpier than an adult.")
### Functions to increase and decrease stats ###
@ -160,7 +163,10 @@ def stroking():
# and health.
def feeding():
os.system('clear')
print("Hungriness of " + pet_variables.pet_name + ": " + pet_variables.pet_hunger * "*")
print("Hungriness of " \
+ pet_variables.pet_name \
+ ": " \
+ pet_variables.pet_hunger * "*")
feeding_confirmed = input("Do you want to feed your pet?")
if feeding_confirmed in ("Y", "y"):
increase_hunger()
@ -189,14 +195,19 @@ def playing():
def poking():
os.system('clear')
if pet_variables.poke_count < 3:
print("You poke " + pet_variables.pet_name + " and it starts to speak.")
print("You poke " \
+ pet_variables.pet_name \
+ " and it starts to speak.")
increase_poke_count()
mixer.init()
mixer.music.load('happy.mp3')
mixer.music.play()
time.sleep(5)
else:
print("You annoyed " + pet_variables.pet_name + "." + " It got angry at you.")
print("You annoyed " \
+ pet_variables.pet_name \
+ "." \
+ " It got angry at you.")
decrease_happiness()
mixer.init()
mixer.music.load('angry.mp3')

View File

@ -20,7 +20,8 @@ while pet_functions.is_alive():
pet_variables.beginning_finished = True
print()
print()
print("Your pet is currently a youngling which means it's needs a lot of attention.")
print("Your pet is currently a youngling which means \
it's needs a lot of attention.")
print("Take good care of it or it will die very soon.")
# checks if the pet has reached a new life stage and updates it accordingly
pet_functions.aging()