SHARE
TWEET

Untitled

a guest Jan 24th, 2020 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import random
  2. import time
  3.  
  4. hero_hp = 100
  5. x = random.randint(1, 12)
  6.  
  7. monster_hp = 100
  8. y = random.randint (1, 6) + random.randint (1, 6)
  9. name = input("\nwpisz swoje imie : ")
  10. crit = y*2
  11. start = random.randint(1, 2)
  12.  
  13.  
  14. while hero_hp > 0 and monster_hp > 0:
  15.     if start == 1:
  16.         print("\n\nture zaczyna !",name)
  17.         time.sleep(1)
  18.         print(name, 'uderza za', x, 'pkt. obrażeń!')
  19.         monster_hp -= x
  20.         print('zycie potwora:', monster_hp)
  21.         time.sleep(1)
  22.         if monster_hp <= 0:
  23.             break
  24.         x = random.randint(1, 12)
  25.         print('\npotwór uderza za', y, 'pkt. obrażeń!')
  26.         hero_hp -= y
  27.         print('zycie :',name, hero_hp)
  28.         time.sleep(1)
  29.         y = random.randint (1, 6) + random.randint (1, 6)
  30.         start = random.randint(1, 2)
  31.    
  32.     elif start == 2:
  33.         print("\n\nture zaczyna potwor!\n")
  34.         time.sleep(1)
  35.         print('potwór uderza za', y, 'pkt. obrażeń!')
  36.         hero_hp -= y
  37.         print('zycie bohatera:', hero_hp)
  38.         time.sleep(1)
  39.         if hero_hp <= 0:
  40.             break
  41.         y = random.randint (1, 6) + random.randint (1, 6)
  42.         print(name, '\n uderza za', x, 'pkt. obrażeń!')
  43.         monster_hp -= x
  44.         print('zycie potwora:', monster_hp)
  45.         time.sleep(1)
  46.         x = random.randint(1, 12)
  47.         start = random.randint(1, 2)
  48.        
  49. if hero_hp > 0:
  50.     print("\nGratulacje wygrałeś!")
  51. elif monster_hp > 0:
  52.     print("\nPorażka!")
  53.  
  54. input("\nNaciśnij przycisk by zakończyć program\n")
  55. exit()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top