Created
March 2, 2018 16:02
-
-
Save Avlyssna/b901153dbae6c3e8b36d449fd87ceeb9 to your computer and use it in GitHub Desktop.
This file contains 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
# Standard-library imports | |
from random import Random | |
VOWELS = 'aeiou' | |
CONSONANTS = 'bcdfghjklmnpqrstvwxyz' | |
def get_seeded_name(seed, length=8): | |
random = Random(seed) | |
word = '' | |
for index in range(length): | |
if index % 2 == 0: | |
word += random.choice(CONSONANTS) | |
else: | |
word += random.choice(VOWELS) | |
return word.title() | |
if __name__ == '__main__': | |
examples = [ | |
"THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG'S BACK 1234567890", | |
"What does it mean when your people say 'The quick brown fox jumped over the lazy dog?'" | |
] | |
for example in examples: | |
print('{} = {}'.format(example, get_seeded_name(example))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment