Created
August 26, 2010 06:42
-
-
Save mattrobenolt/550942 to your computer and use it in GitHub Desktop.
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
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
#!/usr/bin/python | |
if __name__ == '__main__': | |
import random, math, string | |
#words = 'my fist will cheat your face'.split(' ') | |
words = '0 1 2 3 4 5 6 7 8'.split(' ') | |
phrases = [] | |
max = math.factorial(len(words)) | |
loops = 0 | |
while len(phrases) < max: | |
loops+=1 | |
random.shuffle(words) | |
phrase = '%s.' % string.capitalize(' '.join(words)) | |
if not phrase in phrases: | |
phrases.append(phrase) | |
print '%s %d/%d/%d/%d' % (phrase, len(phrases), loops, max-len(phrases), loops-len(phrases)) | |
print '\n', '='*20 | |
print 'Total: %d/%d' % (max, loops) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment