Skip to content

Instantly share code, notes, and snippets.

Created May 18, 2015 00:16
Show Gist options
  • Save anonymous/7f44a9c990e95f5bfd06 to your computer and use it in GitHub Desktop.
Save anonymous/7f44a9c990e95f5bfd06 to your computer and use it in GitHub Desktop.
151 out = ""
152 shift = 0
153 for j in xrange(0,len(ans),4):
154 try:
155 i = j
156 out += inputs[(inputs.index(ans[i])-inputs.index(key[0])-shift)%len(inputs)]
157 shift += inputs.index(ans[i])+1
158 i = j+1
159 out += inputs[(inputs.index(ans[i])-inputs.index(key[0])-shift)%len(inputs)]
160 shift += inputs.index(ans[i])+1
161 i = j+3
162 out += inputs[(inputs.index(ans[i])-inputs.index(key[0])-shift)%len(inputs)]
163 shift += inputs.index(ans[i])+1
164 i = j+2
165 out += inputs[(inputs.index(ans[i])-inputs.index(key[0])-shift)%len(inputs)]
166 shift += inputs.index(ans[i])+1
167 except:
168 pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment