Skip to content

Commit

Permalink
Simplified the getBlankCipherletterMapping() function.
Browse files Browse the repository at this point in the history
  • Loading branch information
asweigart committed Feb 7, 2013
1 parent 9cedadd commit b57ba46
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions simpleSubHacker.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -31,17 +31,8 @@ def main():




def getBlankCipherletterMapping(): def getBlankCipherletterMapping():
# Returns a dict where the keys are uppercase single-letter strings # Returns a dictionary value that is a blank cipherletter mapping.
# and the values are blank lists. return {'A': [], 'B': [], 'C': [], 'D': [], 'E': [], 'F': [], 'G': [], 'H': [], 'I': [], 'J': [], 'K': [], 'L': [], 'M': [], 'N': [], 'O': [], 'P': [], 'Q': [], 'R': [], 'S': [], 'T': [], 'U': [], 'V': [], 'W': [], 'X': [], 'Y': [], 'Z': []}
# E.g. {'A': [], 'B': [], 'C': [], ...etc}
#
# We will call the single-letter strings in the keys "cipher letters"
# and the single-letter strings in the value's list "possible
# decryption letters".
letterMapping = {}
for letter in LETTERS:
letterMapping[letter] = []
return letterMapping




def addLettersToMapping(letterMapping, cipherword, candidate): def addLettersToMapping(letterMapping, cipherword, candidate):
Expand Down

0 comments on commit b57ba46

Please sign in to comment.