Created
September 23, 2018 16:04
-
-
Save Ge0rg3/b0a9e7656417d3e325746e4ab86e313f to your computer and use it in GitHub Desktop.
Part of the Reply Challenge 2018 Practice Challenges.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
descrambled = [] | |
concword = "" | |
with open('scrambled-words.txt','r') as f: | |
scrambledwords = f.read().split() | |
with open('dictionary.txt','r') as f: | |
dictionary = f.read().split() | |
def checkSame(s,l): | |
if (sorted(s) == sorted(l)) and (len(s) == len(l)): | |
return True | |
else: | |
return False | |
for word in scrambledwords: | |
for dictw in dictionary: | |
dictw = list(dictw) | |
if (checkSame(word,dictw) == True): | |
descrambled.append(dictw) | |
break | |
for i in descrambled: | |
concword += (''.join(i)) | |
print("{FLG:"+hashlib.sha256(concword.lower()).hexdigest()+"}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment