Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- # The Riddler by t0p 2020
- import random
- from os import system
- choices = []
- riddles = {
- 0:["""I speak without a mouth and hear without ears.
- I have no body, but I come alive with wind. What am I?""", ("echo",), False],
- 1:["""You measure my life in hours and I serve you by expiring.
- I’m quick when I’m thin and slow when I’m fat. The wind is my enemy.
- What am I?""", ("candle",), False],
- 2:["""What is seen in the middle of March and April that can’t be seen
- at the beginning or end of either month?""", ("r", "letter r", "the letter r"), False],
- 3:["What disappears when you say its name?", ("silence",), False],
- 4:["""I have keys, but no locks and space, and no rooms.
- You can enter, but you can’t go outside. What am I?""", ("keyboard",), False],
- 5:["What gets wetter the more it dries?", ("towel",), False],
- 6:["Which word in the dictionary is always spelled incorrectly?", ("incorrectly",), False],
- 7:["""What comes once in a minute, twice in a moment,
- but never in a hundred thousand years?""", ("m", "letter m", "the letter m"), False],
- 8:["The more you take, the more you leave behind. What am I?", ("footsteps", "steps", "footprints"), False],
- 9:["""I am not alive, but I grow; I don't have lungs, but I need air;
- I don't have a mouth, but water kills me. What am I?""", ("fire",), False],
- 10:["What do you need to break before you use it?", ("egg",), False],
- 11:["""You have me today,
- Tomorrow you'll have more;
- As your time passes,
- I'm not easy to store;
- I don't take up space,
- But I'm only in one place;
- I am what you saw,
- But not what you see.
- What am I?""", ("memories",), False],
- 12:["""They have not flesh, nor feathers, nor scales, nor bone.
- Yet they have fingers and thumbs of their own.
- What are they?""", ("gloves",), False],
- 13:["""This is as light as a feather, yet no man can hold it for five minutes.
- What am I?""", ("breath", "your breath", "my breath"), False],
- 14:["Poor people have it. Rich people need it. If you eat it you die. what is it?", ("nothing",), False],
- 15:["The more you take away, the bigger I become. What am I?", ("hole", "a hole"), False],
- 16:["""Always in you, Sometimes on you;
- If I surround you, I can kill you.
- What am I?""", ("water",), False],
- 17:["I am full of holes but I can still hold water. What am I?", ("sponge", "a sponge"), False],
- 18:["I can be cracked, I can be made. I can be told, I can be played. What am I?", ("joke", "a joke"), False],
- 19:["What can travel around the world without leaving its corner?", ("stamp", "a stamp"), False],
- 20:["Look in my face, I am somebody; Look in my back, I am nobody. What am I?", ("mirror", "a mirror"), False],
- 21:["What can you keep only after you have given it?", ("word", "your word", "my word"), False],
- 22:["""I follow you all the time and copy your every move,
- but you can’t touch me or catch me. What am I?""", ("shadow", "your shadow", "my shadow"), False],
- 23:["What goes up and down but doesn’t move?", ("stairs", "staircase"), False],
- 24:["What has words, but never speaks, has leaves but doesn't grow?", ("book", "a book"), False],
- 25:["What runs all around a backyard, yet never moves?", ("fence", "a fence", "wall", "a wall"), False],
- 26:["""I am an odd number. Take away a letter and I become even.
- What number am I?""", ("7", "seven"), False],
- 27:["I ask no questions but demand to be answered nevertheless. Who am I?", ("phone", "telephone"), False],
- 28:["What five-letter word becomes shorter when you add two letters to it?", ("short",), False],
- 29:["What begins with an 'e' and only contains one letter?", ("envelope", "an envelope"), False],
- 30:["""A word I know, six letters it contains, remove one letter and 12 remains.
- What is it?""", ("dozens",), False],
- 31:["""I am the beginning of everything, the end of everywhere.
- I’m the beginning of eternity, the end of time and space. What am I?""", ("e", "letter e", "the letter e"), False],
- 32:["Forward I am heavy, but backward I am not. What am I?", ("ton", "word 'ton'", "the word 'ton'"), False],
- 33:["I am a word of letters three; add two and fewer there will be. What word am I?", ("few",), False],
- 34:["What word of five letters has one left when two are removed?", ("stone",), False],
- 35:["What word is pronounced the same if you take away four of its five letters?", ("queue",), False],
- 36:["What can run but never walks, has a mouth but never talks, has a head but never weeps, has a bed but never sleeps?", ("river", "a river"), False],
- 37:["If you drop me I’m sure to crack, but give me a smile and I’ll always smile back. What am I?", ("mirror", "a mirror"), False],
- 38:["I turn once, what is out will not get in. I turn again, what is in will not get out. What am I?", ("key", "a key"), False],
- 39:["People make me, save me, change me, raise me. What am I?", ("money",), False],
- 40:["What can be measured but not seen?", ("time",), False],
- 41:["I occur twice in eternity but I'm always in sight. What am I?", ("t", "letter t", "the letter t"), False],
- 42:["""Someone makes it, but has no need of it. Someone buys it,
- but has no use for it. Someone uses it, but can neither see nor feel it.
- What is it?""", ("coffin", "a coffin"), False],
- 43:["""The eight of us go forth, not back,
- To protect our king from a foe's attack. What are we?""", ("pawns", "chess pawns", "pawn"), False]
- }
- def clear():
- _ = system('clear')
- def choose_riddles():
- while len(choices) < 10:
- num = random.randint(0, len(riddles) - 1)
- if num not in choices:
- choices.append(num)
- def play_game():
- clear()
- print("""
- _____ _ ______ _ _ _ _
- |_ _| | | ___ (_) | | | | |
- | | | |__ ___ | |_/ /_ __| | __| | | ___ _ __
- | | | '_ \ / _ \ | /| |/ _` |/ _` | |/ _ \ '__|
- | | | | | | __/ | |\ \| | (_| | (_| | | __/ |
- \_/ |_| |_|\___| \_| \_|_|\__,_|\__,_|_|\___|_|
- \n\n""")
- score = 0
- choose_riddles()
- for turn in choices:
- answer = input(str(riddles[turn][0] + "\n> "))
- if answer.lower() in riddles[turn][1]:
- print("\nCorrect\n")
- score += 1
- else:
- print("\nIncorrect\n")
- print_results(score)
- def print_results(score):
- if score == 10:
- prestring = "Congratulations! "
- elif score in (8, 9):
- prestring = "Okay! "
- elif 4 < score < 8:
- prestring = "Not bad!"
- elif score in (3, 4):
- prestring = "Ah. "
- else:
- prestring = "Oh dear… "
- print(prestring + "You scored %d out of 10." % score)
- def play_again():
- # returns True or False
- while True:
- answer = input("Do you want to play again? (Y/n) > ")
- if answer.lower() in ("y", "yes"):
- return True
- else:
- return False
- def main():
- while True:
- play_game()
- if not play_again():
- return
- if __name__ == '__main__':
- main()
- exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement