Skip to content

Instantly share code, notes, and snippets.

@adammichaelwood
Created June 9, 2016 17:17
Show Gist options
  • Save adammichaelwood/c58fa55350cce2f46ad0027f4c4e2097 to your computer and use it in GitHub Desktop.
Save adammichaelwood/c58fa55350cce2f46ad0027f4c4e2097 to your computer and use it in GitHub Desktop.
Affirmations
import blessings
import time
import random
t = blessings.Terminal()
name = input(t.yellow("What is your name? "))
aff_prefix = "I, " + name + ", "
fb_prefix = "You "
question = t.red("What is your quest? ") + "\n" + t.bright_black("(I, <name>, <state your quest>.)") + "\n" + t.cyan("> ")
affirm_times = random.randrange(12, 17)
for i in range(affirm_times):
# print(t.yellow(str(i + 1)))
affirmation = input(question)
feedback = affirmation.replace(aff_prefix, fb_prefix)
if (i < affirm_times - 1 ):
loops = i + random.randrange(10)
for j in range(loops):
colornum = random.randrange(1,15)
print(t.color(colornum)(feedback))
time.sleep(random.random())
print("\n")
if ( i == affirm_times - 1 ):
feedback = feedback.upper()
for j in range(i + affirm_times):
print(t.color(j+1)(feedback))
time.sleep(random.random())
print(t.bold("You have proved yourself worthy."))
quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment