Untitled - Posted on September Tue 1st 3:20 PM (Never Expires) - Format: python - This is a modified post titled "with level".
  1. import time,random
  2. player_victory=0
  3. enemy_victory=0
  4. while True:
  5.    for i in range(1,4):
  6.       time.sleep(1.5)
  7.       print('The is phase # '+ str(i))
  8.  
  9.       player_life=random.randint(100,150)
  10.       player_attact=random.randint(30,50)
  11.       enemy_life = random.randint(100,150)
  12.       enemy_attack = random.randint(30,50)
  13.  
  14.       print('You\n'+'HP:'+str(player_life)+'\nAttact:'+str(player_attact))
  15.       print('------------------------')
  16.       time.sleep(1)
  17.       print('Enemy\n'+'HP:'+str(enemy_life)+'\nAttact:'+str(enemy_attack))
  18.       print('------------------------')
  19.       time.sleep(1)
  20.  
  21.       while (player_life>0)and(enemy_life>0):
  22.          player_life=player_life-enemy_attack
  23.          enemy_life =enemy_life -player_attact
  24.          print('You attact the enemy, enemy HP now: '+str(enemy_life))
  25.          print('Enemy attact you, and your HP now: '+ str(player_life))
  26.          print('------------------------')
  27.          time.sleep(1.5)
  28.  
  29.       if player_life > 0 and enemy_life <= 0:
  30.          player_victory +=1
  31.          print('Monster KO.,YOU WIN')
  32.  
  33.       elif player_life <= 0 and enemy_life > 0:
  34.          enemy_victory +=1
  35.          print('KO!YOU DIE')
  36.       else:
  37.          print('TIE GAME!')
  38.  
  39.    if player_victory > enemy_victory:
  40.          time.sleep(1)
  41.          print('【FINAL RESULT:YOU WIN!】')
  42.    elif enemy_victory > player_victory:
  43.       print('【FINAL RESULT:YOU LOSE!】')
  44.    else:
  45.       print('【FINAL RESULT:TIE!】')
  46.  
  47.  
  48.    final= input('do you want a play a new game?')
  49.    if final =='n':
  50.       break

New Paste

Paste Options

Recent Pastes

12 days ago

stripe

12 days ago

Untitled

13 days ago

run stripe liste

15 days ago

Untitled

16 days ago

remove duplicate

19 days ago

Untitled

21 days ago

Untitled

21 days ago

Untitled

22 days ago

Untitled

22 days ago

try this one