Skip to content

Instantly share code, notes, and snippets.

/wordcube.py Secret

Created September 2, 2016 19:39
Show Gist options
  • Save anonymous/8d5493a6dff78019d3d6d6c87337a457 to your computer and use it in GitHub Desktop.
Save anonymous/8d5493a6dff78019d3d6d6c87337a457 to your computer and use it in GitHub Desktop.
letters = 'REQUESTS'
len_ = len(letters)
range_ = range(len_)
array = [[[letters[(x+y+z) % len_] for x in range_] for y in range_] for z in range_]
wordcube = [[''.join(word) for word in layer] for layer in array]
wordcube = ['\n'.join(layer) for layer in wordcube]
wordcube = '\n\n'.join(wordcube)
print(wordcube)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment