Project Python | Decipher game!

Quote of AWESOMENESS: “A little progress every day adds up to big results.” ~ Satya Nani

 

Hey, there! Today I have a project (made by yours truly 😉 ) that I made with Python!

The code has many challenges and things to be solved in order to proceed with the game. In my next blog, I will have more on encryption, ciphers, and some code to create a decipher! Use your awesome skills!

List of ciphers to solve in my code are: 

  • Shift Cipher
  • A1Z26 Cipher
  • PigPen Cipher
import time
import random

player_name = input("What's your name?  ")

begin = input("Hello, it's good to have you back to base. We have another mission!")

print("\n")

print("Here's the back story:")

time.sleep(1)

print("Approximately 3.5 hours ago, we found out that one \nof our agents had been a double agent this whole time! \nAt night, he stole our secret codes in a suitcase and ran of into the night. \nWe have reason to believe that he hid the suitcase back in the enemies base. \nYour mission whether you choose to accept or not is to go and infiltrate the enemies headquarters and get the suitcase back.")

time.sleep(1)

luck = input("We wish you luck agent!")

print("\n")

time.sleep(1)

start = input("Let's begin!")

first_obstacle = input("You finally made your way into the tunnels under the enemy's base which \nasks for a fifteen-digit code to enter.")

first_obstacle1 = input("\nLuckily, you know that your base has this code stored in their archives \nso you send a message.")

print("...")

time.sleep(1)

print("...")

time.sleep(1)

print("...")

time.sleep(1)

print("...")

time.sleep(1)

print("*phone beeps*")

print("\n")

time.sleep(2)

print("The message sent to you is encrypted and all that you have are these letters:")

time.sleep(.5)

print("FTW PAAD'E BMEEOAPQ UE GZUOADZEMDQDQMX")

hint = input("hint: this is a shift cypher")

time.sleep(2)

print("\n")

player_answer = False

while not player_answer:

    playeranswer = input("What is the code to open the door?  ")

    if playeranswer == "unicornsarereal":

        player_answer = True

    elif playeranswer == "opensesame":

        print("haha... nice try.. but no")

    elif playeranswer == "imcool":

        print("Mhmm I'm sure you are but still not the passcode")

    elif playeranswer == "":

        print("You have to put something. TRY AGAIN")

    else:

        print("TRY AGAIN")

print("\n")

print("Good job, now time to proceed to finding the files")

time.sleep(1.5)

findfiles = input("\nUsing your gps on the special case you're trying to locate, \nyou come across a small safe that you find in the headquarters offices...")

time.sleep(1)

case = input("\nIn order to open the case, you have to solve the following:")

print("op en th es af eb yt ta pp in gt he to of th de sk tw ic ea nd hu mx")

time.sleep(1)

options = input("\nYOU HAVE THREE OPTIONS:")

print("")

print("""

1. Keep hitting the safe until it opens

2. Tap the desk twice, humming

3. Start singing Let It Go

""")

guessed = False

get_caught = 0

hit_the_safe = 0

while not guessed:

    action = input("\nWhat do you have to do to open the safe?  ")

    if action == "1":

        hit_the_safe += 1

        if hit_the_safe > 1:

            print("NO, we did this already and it didn't work, do another one")

        else:

            print("\nUh oh, you keep hitting the safe but it doesn't do anything but sound an alarm!")

            time.sleep(1.5)

            print("You try hiding but it is too late")

            print("")

            print("\"HEY YOU THERE COME HERE!\"")

            run = input("\nWill you RUN or COME?").lower()

            if run == "run":

                print("\nYou try running but they catch you.")

            elif run == "come":

                print("\nYou come with them and think of a way to escape")

            print("")

            trapped = input("You are brought into a room and are trapped. \nFortunately, you sent a distress message to your base in the nick of time. \nOne of the best hackers in your base was able to find out the 5-digit number code to escape.")    

            print("\n CODE: SMILE")

            h = False

            while not h:

                escape = input("What do you input into the keypad to escape?")

                if escape == "45118":

                    print("\n YES, the door slides open and you run back to the safe to unlock it.")

                    h = True

                else:

                    print("ERROR!", escape, "did not work, DO ANOTHER CODE")

    elif action == "2":

        solved = input("\nYes! You did it! The safe opens slowly and you get a small scroll and a key.")

        guessed = True

    elif action == "3":

        print("\nBeautiful voice! But, the safe door doesn't move an inch. TRY AGAIN.")

    elif action == "":

        print("You have to put something")

    else:

        print("Only put 1, 2, or 3")

print("")

scroll = input("You open the small scroll and it reads:")

solve = input("""

                                                 CASE LOCATION:

                                                    ROOM 14

                                                  UNDER QOFDSH

                                     _________                _________    _________    _________   _________         _________    

                    |  |         |  |        |      /\      |         |  |        |  |         |           |    /  |        |

                    |  |         |  |         |     /● \     |         |  |         |  |         |           |   /   |         |

                    |  |         |  |         |    /    \    |         |  |         |  |         |          ●|  < ●  |         |

PASSCODE:           |  |         |  |         |   /      \   |         |  |         |  |         |           |   \   |         |

           _________|  |_________|  |         |  /        \  |_________|  |         |  |_________|  _________|    \  |         |

""")

print("\nYou put the scroll back and run quitely to room 12")

answer = False

print("""

    Pick where you are going to check:

    1. Under the desk

    2. Under the carpet

    3. Behind the painting

    """)

while not answer:

    answered = input("Where is the case?  ")

    if answered == "1":

        print("\nYou look under the desk but find nothing. TRY AGAIN.")

    elif answered == "2":

        print("\nYou lift the carpet up and find another safe.")

        answer = True

    elif answered == "3":

        print("\nYou take down the painting on the wall but find just wall. TRY AGAIN.")

    else:

        print("Enter 1, 2, or 3 only")

suitcase = input("\nYOU'VE SUCCESSFULLY FOUND WHERE THEY HID THE CASE")

but = input("However, you still need the passcode...")

player_answer = False

while not player_answer:

    playeranswer = input("Passcode to open the safe is:   ")

    if playeranswer == "opensesame":

        player_answer = True

    else:

        print("TRY AGAIN")

print("""

YOU DID IT YAY! YOU HEAD BACK TO YOUR BASE. GOOD JOB, AGENT! WE KNEW WE COULD COUNT ON YOU.

""")

              

    Try the code and add more levels and experiment with it! 

have a great day and a great weekend :))

 

Yours truly, 

L.O.A.S.H

 


 © Elizabeth Anne Villoria

 

Advertisements

2 thoughts on “Project Python | Decipher game!

Comments are closed.