Skip to content

Instantly share code, notes, and snippets.

@lucasrcezimbra
Forked from jbiason/fujam.py
Created August 17, 2017 13:57
Show Gist options
  • Save lucasrcezimbra/8fb1cdcae208a2a7ee09d31bca5288db to your computer and use it in GitHub Desktop.
Save lucasrcezimbra/8fb1cdcae208a2a7ee09d31bca5288db to your computer and use it in GitHub Desktop.
from __future__ import print_function
import random
import argparse
CONSONANTS = ['f', 'j', 'c', 'l', 'n']
PASSPHRASE = '{}u{}am para as {}o{}i{}as'
def totally_random():
"""Run a totally random way."""
random.shuffle(CONSONANTS)
print(PASSPHRASE.format(*CONSONANTS))
def switch_two():
"""Run by changing two steps at a time."""
first = random.randint(0, 1)
second = random.randint(2, 4)
tmp = CONSONANTS[first]
CONSONANTS[first] = CONSONANTS[second]
CONSONANTS[second] = tmp
print(PASSPHRASE.format(*CONSONANTS))
if __name__ == "__main__":
args = argparse.ArgumentParser()
args.add_argument('-t', '--totally',
dest='totally',
default=False,
action='store_true',
help='Like, toootaly random')
args.add_argument('-s', '--short',
dest='short',
default=False,
action='store_true',
help='Not so random')
result = args.parse_args()
if result.totally:
totally_random()
elif result.short:
switch_two()
else:
print('Dude, option!')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment