Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pickle
- class Clue(object):
- def __init__(self, name, killer):
- self.name = name
- self.killer = killer
- def getKiller(self):
- print decode(self.killer)
- def encode(s):
- a = []
- b = []
- for i in range(len(s)):
- t = ord(s[i])
- x1, x2 = divide(t)
- a.append(x1)
- b.append(x2)
- return (a, b)
- def decode(s):
- a, b = s
- final = []
- for i in range(len(a)):
- t1 = a[i]
- t2 = b[i]
- p = combine(t1, t2)
- x = chr(p)
- final.append(x)
- print final
- return ''.join(final)
- def divide(t):
- t = str(t)
- return (''.join([ t[x] for x in range(0, len(t), 2) ]), ''.join([ t[x] for x in range(1, len(t), 2) ]))
- def combine(t1, t2):
- p = []
- for i in t1:
- p += [i]
- for i in range(len(t2)):
- p.insert(2 * i + 1, t2[i])
- return int(''.join(p))
- secret = (['9',
- '9',
- '11',
- '12',
- '11',
- '9',
- '14',
- '11',
- '13',
- '1',
- '9',
- '14',
- '11',
- '9',
- '11',
- '10',
- '15',
- '16',
- '14',
- '17',
- '9',
- '16',
- '11',
- '14',
- '1',
- '12',
- '4',
- '1',
- '4',
- '9',
- '9',
- '9',
- '19',
- '9',
- '15',
- '10',
- '9',
- '9',
- '1',
- '6',
- '18',
- '17',
- '11',
- '1',
- '12',
- '4',
- '1',
- '9',
- '9',
- '9',
- '9',
- '17',
- '15',
- '18',
- '16',
- '15',
- '10',
- '9',
- '9',
- '1',
- '11',
- '9',
- '16',
- '11',
- '9',
- '16',
- '1',
- '12',
- '5',
- '1',
- '7',
- '16',
- '12',
- '5',
- '1',
- '8',
- '12',
- '5',
- '1',
- '4',
- '10',
- '12',
- '5',
- '1',
- '8',
- '3',
- '17',
- '15',
- '18',
- '18',
- '11',
- '14',
- '3',
- '1',
- '12',
- '5',
- '1',
- '4',
- '4',
- '18',
- '12',
- '5',
- '1',
- '8',
- '3',
- '5',
- '3',
- '1',
- '12',
- '5',
- '1',
- '9',
- '8',
- '3',
- '4',
- '4',
- '3',
- '1',
- '12',
- '5',
- '1',
- '9',
- '8',
- '3',
- '4',
- '5',
- '3',
- '1',
- '12',
- '4',
- '4',
- '1',
- '9',
- '8',
- '3',
- '5',
- '3',
- '1',
- '12',
- '4',
- '4',
- '1',
- '9',
- '8',
- '3',
- '5',
- '3',
- '1',
- '12',
- '4',
- '5',
- '1',
- '9',
- '8',
- '3',
- '5',
- '3',
- '1',
- '12',
- '4',
- '5',
- '1',
- '9',
- '8',
- '3',
- '4',
- '5',
- '3',
- '1',
- '12',
- '4',
- '5',
- '1',
- '9',
- '8',
- '3',
- '4',
- '5',
- '3',
- '1',
- '12',
- '4',
- '5',
- '1',
- '9',
- '8',
Add Comment
Please, Sign In to add comment