Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random, time
- def slowPrint(text):
- for character in text:
- if character == 'I':
- # I's are displayed in lowercase for style:
- print('i ', end='', flush=True)
- else:
- # All other characters are displayed normally:
- print(character + ' ', end='', flush=True)
- time.sleep(0.1)
- print() # Print two newlines at the end.
- print()
- # Prompt for a question:
- slowPrint('MAGIC FORTUNE BALL')
- time.sleep(0.5)
- slowPrint('ASK ME YOUR YES/NO QUESTION.')
- input('> ')
- # Display a brief reply:
- replies = [
- 'LET ME THINK ON THIS...',
- 'AN INTERESTING QUESTION...',
- 'HMMM... ARE YOU SURE YOU WANT TO KNOW..?',
- 'DO YOU THINK SOME THINGS ARE BEST LEFT UNKNOWN..?',
- 'I MIGHT TELL YOU, BUT YOU MIGHT NOT LIKE THE ANSWER...',
- 'YES... NO... MAYBE... I WILL THINK ON IT...',
- 'AND WHAT WILL YOU DO WHEN YOU KNOW THE ANSWER? WE SHALL SEE...',
- 'I SHALL CONSULT MY VISIONS...',
- 'YOU MAY WANT TO SIT DOWN FOR THIS...',
- ]
- slowPrint(random.choice(replies))
- slowPrint('.' * random.randint(4, 12)) # Dramatic pause.
- slowPrint('I HAVE AN ANSWER...')
- time.sleep(1)
- answers = [
- 'YES, FOR SURE',
- 'MY ANSWER IS NO',
- 'ASK ME LATER',
- 'I AM PROGRAMMED TO SAY YES',
- 'THE STARS SAY YES, BUT I SAY NO',
- 'I DUNNO MAYBE',
- 'FOCUS AND ASK ONCE MORE',
- 'DOUBTFUL, VERY DOUBTFUL',
- 'AFFIRMATIVE',
- 'YES, THOUGH YOU MAY NOT LIKE IT',
- 'NO, BUT YOU MAY WISH IT WAS SO',
- ]
- slowPrint(random.choice(answers))
Add Comment
Please, Sign In to add comment