Advertisement
cmiN

hertz-py-chall

Apr 5th, 2012
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.27 KB | None | 0 0
  1. import math
  2. string = 'hel Lo Myn AmeIsF utIlityh oWARe you?!'
  3.  
  4.  
  5. def mixup(x):
  6.     total = 0
  7.     newAnswer = ''
  8.     cut = string.split()
  9.     mixedCut = cut[1]+cut[4]+cut[0]+cut[6]+cut[3]+cut[5]+cut[2]
  10.  
  11.     while x < 10:
  12.         for char in 'alabaster':
  13.             total += ord(char)
  14.         x += 1
  15.    
  16.     #print total     ## 1886 (for x == 8)
  17.     #print mixedCut  ## L|o|u|t|I|l|i|t|y|h|h |e |l |y |o |u |? |! |A |m |e |I |s |F |o |W |A |R |e |M |y |n
  18.                       # 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31
  19.     spice = mixedCut[total/113] # 16
  20.     tangerine = mixedCut[total/(70*4)] # 6
  21.     coldCut = mixedCut[int(total/math.pow(7.29,4))] # 0
  22.     ham = mixedCut[total/157] # 12
  23.     icedCream = mixedCut[total/148] # 12 --- deci total e futut fiindca ai avea 2 caractere la fel si `whoami?` nu are
  24.     alarm = mixedCut[int(total/math.pow(26,2))] # 2
  25.     herpes = mixedCut[total/176] # 10
  26.    
  27.     answer = (spice,tangerine,coldCut,ham,icedCream,alarm,herpes)
  28.     for char in answer:
  29.         newAnswer += str(char)
  30.     print newAnswer
  31.    
  32.    
  33. for i in range(7, 10): # crapa mai jos de 7
  34.     mixup(i)
  35. #print 'The above should read \"WhoAmI?\" but it won\'t!'
  36. #print 'What could I possibly be doing wrong?'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement