Guest User

POC 2013 - POWER OF XX _ Easy2.net Solver

a guest
Nov 8th, 2013
244
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # /usr/bin/python
  2. # power of xx _ solver
  3. # 2013 POC - Power Of XX - Binary Easy2.net Solver
  4. # by sweetchip.
  5.  
  6. minute = 44
  7. month = 10
  8. day = 26
  9. dayofyear = 299
  10. hour = 23
  11.  
  12. def solve1(str, range):
  13.     test = int(str)
  14.  
  15.     j = range % 3
  16.     i = 2
  17.  
  18.     if(j==0):
  19.         test -= ((day * i) + (minute * i) - (hour * 2))
  20.     elif(j==1):
  21.         test -= ((month * 3) + (minute * 2 ) - (hour * j))
  22.     elif(j == 2):
  23.         test -= ((dayofyear - (month * (j * 5)) - (minute * j) - (hour * (i+4)) - (j* i)))
  24.     return test
  25.  
  26. def solve2(input):
  27.     encoding_table = "9pMaVs5DxiOPGe8JETXYmg3lbudro6Qk1WLKwyhfnS4Iv0ABtjUCc7RZz2NFHq"
  28.     encoding_table += "KfeROdEILJs5W6D1m4XFtH7YbwgrUConPuqQBcSxT092zljv8yMAGhpZN3akVi"
  29.     encoding_table += "8vxekVPpYlsXDAujWoJEingTGf3mCh59LROt6cdUNMb41zH7Kr0yS2BIFZqawQ"
  30.     encoding_table += "Hv8VzYa5b1FMGNODW4kwX9L3hK6SqsTtyxoE0Z7fPJIgrCAQiljBuenRcp2dUm"
  31.     encoding_table += "fgnCw4HPJRdXKIq31YNDZMS82OjA7eUxpozasVmykiQrTFLW6htGb9B0lEcvu5"
  32.     encoding_table += "jxLaZdWYngAfKGNhzTcXQU7Jy9sFbp0eRI1ECrv23PSw846oH5MBVtlDiOqumk"
  33.     encoding_table += "U0tnl9bVK4iB2LzZXy7PaCHcAI5pOsSfjgqkr1vuRTFEo8Dxmhw3QGdeJM6WYN"
  34.     encoding_table += "gWYN9w4LuPjxJl1MhOkniQy8CBUXr6THaKDctEdb0Imp32VfFZGvAS5ezqsR7o"
  35.     encoding_table += "wj3J9fL8QY2kArXKgOEzmSdqHpcMsn1ahGWxCe7yPIlTuDRb6F40oZtiUBvV5="
  36.    
  37.     d = 0
  38.     array = input.split(' ')
  39.     result = ""
  40.     for i in array:
  41.         if i == "":
  42.             break;
  43.         test = int(i)
  44.         result += str(test ^ ord(encoding_table[d + 10]))
  45.         result += " "
  46.         d += 1
  47.         #str1 = (test ^ )
  48.     return result
  49.  
  50. chicken = "144 207 93 170 111 25 130 144 21 152 172 -3 113 164 -24 94 117 -25 173 106 77 169 119 15 135 127 9 111 123 -12 109 218 61 155 98 50 199 131 -2 168 205 75 169 164 24 139 116 95 127 113 71 102 141 -18 152 153 28 111 131 74 207 201 -21 174 155 74 138 164 -7 179 215 94 187 142 55 147 99 64 176 117 25 193 177 47 135 111 -5 108 137 -8 132 120 "
  51. # Chicken
  52. chicken = "210 209 22 126 188 29 212 101 24 125 145 -22 180 134 -30 162 107 18 142 210 8 185 95 -23 221 123 54 183 180 39 103 145 57 141 181 56 141 138 -25 124 133 "
  53. # Egg
  54. chickenarr = chicken.split(' ')
  55.  
  56. solve1_result = ""
  57. for i in range(0, len(chickenarr)-1):
  58.     solve1_result += str(solve1(chickenarr[i], i)) + " "
  59.  
  60. print solve1_result
  61.  
  62. solve2_result = solve2(solve1_result)
  63. l_result = ""
  64. result = solve2_result.split(" ")
  65. for i in result:
  66.     if i == '':
  67.         break
  68.         print int(i)
  69.     l_result += chr(int(i))
  70.  
  71. print l_result[::-1]
RAW Paste Data