Skip to content

Instantly share code, notes, and snippets.

@jpetazzo
Created April 18, 2021 13:14
Show Gist options
  • Save jpetazzo/bfaf0c496d9b3184df81c98439dd7f1d to your computer and use it in GitHub Desktop.
Save jpetazzo/bfaf0c496d9b3184df81c98439dd7f1d to your computer and use it in GitHub Desktop.
Shut up, Moby, you're drunk
#!/usr/bin/env python
import random
import unicodedata
partial_states = {
'o': 'O贸貌么玫掳酶',
'O': 'o脫脪脭脮0脴惟',
'贸': '脫o貌么酶',
'貌': '脪o贸么酶',
'么': '脭o贸貌酶玫',
'玫': '脮o么',
'脫': '贸O脪脭脴',
'脪': '貌O脫脭脴',
'脭': '么O脪脫脴脮',
'脮': '玫O脭',
'掳': '路o',
'路': '掳',
'酶': '脴o',
'脴': 'O酶',
}
complete_states = partial_states.copy()
for source, targets in partial_states.items():
for target in targets:
if target not in complete_states:
complete_states[target] = ''
if source not in complete_states[target]:
complete_states[target] += source
MIN_STRIDE = 1
MAX_STRIDE = 5
stride = 3
state = 'O'
output = ''
for i in range(random.randint(5, 20)):
state = random.choice(complete_states[state])
stride += random.choice([-2, -1, -1, 0, 0, 0, 1, 1, 2])
stride = min(stride, MAX_STRIDE)
stride = max(stride, MIN_STRIDE)
output += stride*state
output += ' ' + random.choice(['!', '...', '.', '?'])
print(output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment