Skip to content

Instantly share code, notes, and snippets.

@spscream
Last active December 11, 2015 13:58
Show Gist options
  • Select an option

  • Save spscream/4611147 to your computer and use it in GitHub Desktop.

Select an option

Save spscream/4611147 to your computer and use it in GitHub Desktop.
Gist of puzzle 'barrel-cypher' solving. http://www.codercharts.com/puzzle/barrel-cypher
import sys;g=open(sys.argv[1]).next;n=range
for o in n(int(g())):
r,p,c=('',0,g()[:-1])
for w in g()[:-1]:
if w==" ":r+=w
else:r+=chr(n(97,123)[ord(w)-97-int((c+c[::-1])[p%len(c*2)])]);p+=1
print r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment