Skip to main content
Code Review

Return to Question

Tweeted twitter.com/StackCodeReview/status/995113347346501632
edited tags
Link
Gareth Rees
  • 50.1k
  • 3
  • 130
  • 210
Source Link

Python3 Health System

I made a code for a health system for the game I'm creating. I made it myself and I wanted some criticism on how to make it better. Thanks for viewing.

## Health system
import time
SH = 100
PA = True
while PA == (True):
 DMG = input("How much damage would you like to take?" )
 Output = int(SH) - int(DMG) 
 if Output == (80):
 print("You took 20 damage!")
 print(" --------------")
 print("|しかくしかく|しかくしかく|しかくしかく|しかくしかく| |")
 print(" --------------")
 elif Output == (60):
 print("You took 40 damage!")
 print(" --------------")
 print("|しかくしかく|しかくしかく|しかくしかく| | |")
 print(" --------------")
 elif Output == (40):
 print("You took 60 damage!")
 print(" --------------")
 print("|しかくしかく|しかくしかく| | | |")
 print(" --------------") 
 elif Output == (20):
 print("You took 80 damage!")
 print(" --------------")
 print("|しかくしかく| | | | |")
 print(" --------------")
 elif Output == (0):
 print("You took 100 damage!")
 print(" --------------")
 print("| | | | | |")
 print(" --------------")
 print("You died!")
 else:
 print("That isn't a command")
 
 PA = input("Would you like to play again? |Y/N| ")
 if PA == ("Y"):
 PA = True
 elif PA == ("N"):
 PA = False
 print("The program will now close")
 time.sleep(5)
 else:
 print("That is not a command...")
lang-py

AltStyle によって変換されたページ (->オリジナル) /