Skip to content

Instantly share code, notes, and snippets.

@Avlyssna
Created March 2, 2018 16:02
Show Gist options
  • Save Avlyssna/b901153dbae6c3e8b36d449fd87ceeb9 to your computer and use it in GitHub Desktop.
Save Avlyssna/b901153dbae6c3e8b36d449fd87ceeb9 to your computer and use it in GitHub Desktop.
# 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