Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. letters = ['a', 'b', 'c', 'd', 'e', 'f']
  4.  
  5. def testAllCombinationsStartingWith(base, depth):
  6.     for letter in letters:
  7.         newBase = base + letter
  8.         isCorrect = crypt(newBase)
  9.         if (not isCorrect and depth > 1):
  10.             testAllCombinationsStartingWith(newBase, depth - 1)
  11.        
  12.  
  13. def crypt(word):
  14.     print 'testing', word
  15.     return False;  # return crypt result here
  16.  
  17.  
  18. def main():
  19.     maxLength = 3
  20.     testAllCombinationsStartingWith('', maxLength)
  21.  
  22. if __name__ == "__main__":
  23.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement