mansz81

pickle.py

Mar 8th, 2022 (edited)
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.98 KB | None | 0 0
  1. import pickle
  2.  
  3. class Clue(object):
  4.  
  5. def __init__(self, name, killer):
  6.     self.name = name
  7.     self.killer = killer
  8.  
  9. def getKiller(self):
  10. print decode(self.killer)
  11.  
  12. def encode(s):
  13.     a = []
  14.     b = []
  15. for i in range(len(s)):
  16.     t = ord(s[i])
  17.     x1, x2 = divide(t)
  18.     a.append(x1)
  19.     b.append(x2)
  20.  
  21. return (a, b)
  22.  
  23. def decode(s):
  24.     a, b = s
  25.     final = []
  26.     for i in range(len(a)):
  27.         t1 = a[i]
  28.         t2 = b[i]
  29.         p = combine(t1, t2)
  30.         x = chr(p)
  31.         final.append(x)
  32. print final
  33. return ''.join(final)
  34.  
  35. def divide(t):
  36. t = str(t)
  37. return (''.join([ t[x] for x in range(0, len(t), 2) ]), ''.join([ t[x] for x in range(1, len(t), 2) ]))
  38.  
  39. def combine(t1, t2):
  40. p = []
  41. for i in t1:
  42. p += [i]
  43.  
  44. for i in range(len(t2)):
  45. p.insert(2 * i + 1, t2[i])
  46.  
  47. return int(''.join(p))
  48.  
  49. secret = (['9',
  50. '9',
  51. '11',
  52. '12',
  53. '11',
  54. '9',
  55. '14',
  56. '11',
  57. '13',
  58. '1',
  59. '9',
  60. '14',
  61. '11',
  62. '9',
  63. '11',
  64. '10',
  65. '15',
  66. '16',
  67. '14',
  68. '17',
  69. '9',
  70. '16',
  71. '11',
  72. '14',
  73. '1',
  74. '12',
  75. '4',
  76. '1',
  77. '4',
  78. '9',
  79. '9',
  80. '9',
  81. '19',
  82. '9',
  83. '15',
  84. '10',
  85. '9',
  86. '9',
  87. '1',
  88. '6',
  89. '18',
  90. '17',
  91. '11',
  92. '1',
  93. '12',
  94. '4',
  95. '1',
  96. '9',
  97. '9',
  98. '9',
  99. '9',
  100. '17',
  101. '15',
  102. '18',
  103. '16',
  104. '15',
  105. '10',
  106. '9',
  107. '9',
  108. '1',
  109. '11',
  110. '9',
  111. '16',
  112. '11',
  113. '9',
  114. '16',
  115. '1',
  116. '12',
  117. '5',
  118. '1',
  119. '7',
  120. '16',
  121. '12',
  122. '5',
  123. '1',
  124. '8',
  125. '12',
  126. '5',
  127. '1',
  128. '4',
  129. '10',
  130. '12',
  131. '5',
  132. '1',
  133. '8',
  134. '3',
  135. '17',
  136. '15',
  137. '18',
  138. '18',
  139. '11',
  140. '14',
  141. '3',
  142. '1',
  143. '12',
  144. '5',
  145. '1',
  146. '4',
  147. '4',
  148. '18',
  149. '12',
  150. '5',
  151. '1',
  152. '8',
  153. '3',
  154. '5',
  155. '3',
  156. '1',
  157. '12',
  158. '5',
  159. '1',
  160. '9',
  161. '8',
  162. '3',
  163. '4',
  164. '4',
  165. '3',
  166. '1',
  167. '12',
  168. '5',
  169. '1',
  170. '9',
  171. '8',
  172. '3',
  173. '4',
  174. '5',
  175. '3',
  176. '1',
  177. '12',
  178. '4',
  179. '4',
  180. '1',
  181. '9',
  182. '8',
  183. '3',
  184. '5',
  185. '3',
  186. '1',
  187. '12',
  188. '4',
  189. '4',
  190. '1',
  191. '9',
  192. '8',
  193. '3',
  194. '5',
  195. '3',
  196. '1',
  197. '12',
  198. '4',
  199. '5',
  200. '1',
  201. '9',
  202. '8',
  203. '3',
  204. '5',
  205. '3',
  206. '1',
  207. '12',
  208. '4',
  209. '5',
  210. '1',
  211. '9',
  212. '8',
  213. '3',
  214. '4',
  215. '5',
  216. '3',
  217. '1',
  218. '12',
  219. '4',
  220. '5',
  221. '1',
  222. '9',
  223. '8',
  224. '3',
  225. '4',
  226. '5',
  227. '3',
  228. '1',
  229. '12',
  230. '4',
  231. '5',
  232. '1',
  233. '9',
  234. '8',
Add Comment
Please, Sign In to add comment