Want more features on Pastebin? Sign Up, it's FREE!
Guest

Broken Program

By: a guest on Aug 29th, 2013  |  syntax: None  |  size: 0.78 KB  |  views: 56  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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!")
clone this paste RAW Paste Data