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