-
-
Save lucasrcezimbra/67fc7d37564f112c222bcb4e842a2640 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
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) | |
CONSONANTS[first], CONSONANTS[second] = CONSONANTS[second], CONSONANTS[first] | |
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!') | |
args.print_help() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment