SHARE
TWEET

Broken Program

a guest Aug 29th, 2013 58 Never
  1. strength = int(input('Initial strength: '))
  2.  
  3. distance = int(input('Distance to person: '))
  4.  
  5. rayLength = []
  6.  
  7. for i in range(0,distance):
  8.  
  9.      strength *= 0.9
  10.  
  11.      if strength > 50:
  12.           rayLength.append('X')
  13.  
  14.      elif strength > 25:
  15.          rayLength.append('x')
  16.  
  17.      elif strength > 10:
  18.          rayLength.append('.')
  19.  
  20.      else:
  21.           rayLength.append(' ')
  22.          
  23. if rayLength[-1] == ' ':
  24.  
  25.     print(' '*(3+len(rayLength))+' |')
  26.  
  27.     print('p=='+''.join(rayLength)+'P|')
  28.  
  29.      print(' '*(3+len(rayLength))+' |')
  30.  
  31.      print("The lab assistant survives!")
  32.  
  33. else:
  34.  
  35.      print(' '*(3+len(rayLength))+'\|/')
  36.  
  37.      print('p=='+''.join(rayLength)+'-*-')
  38.  
  39.      print(' '*(3+len(rayLength))+'/|\\')
  40.  
  41.      print("You have 1 less lab asistant!")
RAW Paste Data
Top