Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Simplified the getBlankCipherletterMapping() function.

  • Loading branch information...
commit b57ba46d75b21cbcda45dc6349f27566563ea2eb 1 parent 9cedadd
@asweigart authored
Showing with 2 additions and 11 deletions.
  1. +2 −11 simpleSubHacker.py
View
13 simpleSubHacker.py
@@ -31,17 +31,8 @@ def main():
def getBlankCipherletterMapping():
- # Returns a dict where the keys are uppercase single-letter strings
- # and the values are blank lists.
- # 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
+ # Returns a dictionary value that is a blank cipherletter mapping.
+ 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': []}
def addLettersToMapping(letterMapping, cipherword, candidate):
Please sign in to comment.
Something went wrong with that request. Please try again.