Skip to content

Instantly share code, notes, and snippets.

@bennuttall
Created November 16, 2013 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bennuttall/7494499 to your computer and use it in GitHub Desktop.
Save bennuttall/7494499 to your computer and use it in GitHub Desktop.
tudor puzzle
from itertools import product
puzzle = [24, 0, 12, 32, 0, 44, 23, 15, 0, 25, 24, 0, 33, 22, 0, 34, 21, 0, 15, 33, 22, 31, 12, 14, 0, 32, 15, 0, 24, 43, 0, 23, 15, 33, 42, 54, 0, 24, 0, 23, 12, 51, 15, 0, 32, 12, 42, 42, 24, 15, 14, 0, 43, 24, 53, 0, 44, 24, 32, 15, 43]
nums = product([1,2,3,4,5], repeat=2)
lets = [chr(n) for n in range(65, 91)]
combs = zip(nums, lets)
d = {str(a) + str(b): c for (a, b), c in combs}
d['0'] = ' '
ans = ''.join(d[str(p)] for p in puzzle)
print(ans)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment