Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Hello! Welcome to my AP Create task program. This program is primarily a text-based choose-your-own-adventure style game. The user is given 3 options in 3 different scenarios, and depending on their responses, the outcome changes.
- import sys, time
- #Defining one of the four different speeds of typing. This will primarily be used for printing [CONSOLE:].
- def print_now(str):
- for letter in str:
- sys.stdout.write(letter)
- sys.stdout.flush()
- time.sleep(0)
- #Defining one of the four different speeds of typing. This will primarily be used for text before the "CONSOLE" is booted.
- def print_fast(str):
- for letter in str:
- sys.stdout.write(letter)
- sys.stdout.flush()
- time.sleep(0.05)
- #Defining one of the four different speeds of typing. This will primarily be used for simulating text printed by the [CONSOLE:].
- def print_slow(str):
- for letter in str:
- sys.stdout.write(letter)
- sys.stdout.flush()
- time.sleep(0.08)
- #Defining one of the four different speeds of typing. This will primarily be used for printing the dots that simulate the [CONSOLE:] loading a test or scenario.
- def print_loading(str):
- for letter in str:
- sys.stdout.write(letter)
- sys.stdout.flush()
- time.sleep(0.7)
- #Creating an indentation between the "run" command that shows up in Python.
- '''print_now("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
- print_fast("\nHELLO. WELCOME TO TEST 64A2P.")
- time.sleep(1)
- print_fast("\nIN THIS TEST, YOUR DECISION-MAKING, (VIRTUAL) SITUATIONAL AWARENESS, AND HUMANITY WILL BE ASSESSED.")
- time.sleep(1)
- print_fast("\nBEFORE WE BEGIN, PLEASE IDENTIFY YOURSELF.")
- time.sleep(1)
- #Obtaining the user's preferred username.
- user = raw_input('\nTEST_SUBJECT: ')
- time.sleep(0.5)
- print_fast("\nWELCOME, TEST_SUBJECT: " + user + ".")
- time.sleep(2)
- print_fast("\nTHE TEST WILL NOW BEGIN. BOOTING CONSOLE")
- print_loading("...")
- time.sleep(1)
- #Setting the stage for the kind of program this will be and helping the user to underestand as well. Also simulating realism with [CONSOLE:].
- print_now("\n[CONSOLE:] ")
- print_slow("BOOT COMPLETE. RUN TEST: TEST_1")
- time.sleep(2)
- print_now("\n[CONSOLE:] ")
- print_slow("TEST_1: SPLIT-SECOND_DECISION-MAKING. LOADING")
- print_loading("...")
- time.sleep(0.5)
- print_now("\n[CONSOLE:] ")
- print_slow("COMPLETE. SCENARIO_1: INTRUDER. LOADING")
- print_loading("...")
- time.sleep(0.5)
- print_now("\n[CONSOLE:] ")
- print_slow("COMPLETE. TEST BEGINNING IN:")
- time.sleep(0.5)
- print_now("\n\n[CONSOLE:] ")
- print_slow("5")
- time.sleep(1)
- print_now("\n\n[CONSOLE:] ")
- print_slow("4")
- time.sleep(1)
- print_now("\n\n[CONSOLE:] ")
- print_slow("3")
- time.sleep(1)
- print_now("\n\n[CONSOLE:] ")
- print_slow("2")
- time.sleep(1)
- print_now("\n\n[CONSOLE:] ")
- print_slow("1")
- time.sleep(1)
- print_now("\n\n")
- print_now("[CONSOLE:] ")
- print_slow("TEST_1 BEGIN. INITIATING SCENARIO_1.")
- time.sleep(1)
- print_now("\n\n")
- print_now("[CONSOLE:] ")
- print_fast("THIS SCENARIO WILL CONSIST OF 3 QUESITONS AND THE OUTCOME OF THE THREE QUESTIONS AND THE QUESTIONS THEMSELVES MAY CHANGE DEPENDING ON YOUR REPSONSE.")
- time.sleep(1)
- print_fast("LOCATION: YOUR RESIDENCE LOCATED IN DETROIT, MICHIGAN.")
- time.sleep(1)
- print_fast("\nSCENARIO: YOU ARE IN YOUR BEDROOM. THE TIME IS 2:43 A.M. YOU HEAR A NOISE IN A ROOM INSIDE OF YOUR HOUSE.")
- time.sleep(1)
- print_fast("\nINQUIRY: WHAT WOULD YOU DO IN THIS SITUATION?")
- time.sleep(1)
- print_fast("\nINSTRUCTIONS: PLEASE SELECT YOUR CHOICE BY TYPING 1, 2, OR 3 FOR THE QUESTIONS FOLLOWING THE SITUATION STATEMENT.")
- time.sleep(1)
- print_fast("\nOPTIONS: (1) ACQUIRE A FIREARM AND INVESTIGATE; (2) ACQUIRE A FLASHLIGHT AND INVESTIGATE; (3) CALL THE POLICE")
- time.sleep(1)
- print_fast("\nSTATEMENT: YOU HAVE 10 SECONDS TO CHOOSE.")
- time.sleep(1)'''
- #Gives the user a choice between one of three options. Depending on the answer that they give, the ending may change relative to other choices that they may have taken.
- input=input("PLEASE ENTER YOUR CHOICE: ")
- if input=="1":
- time.sleep(1)
- print_fast("\nYOU OBTAIN THE FIREARM FROM YOUR BEDSIDE TABLE.")
- time.sleep(1)
- print_fast("\nAS YOU WANDER CLOSER TO THE SOURCE OF THE NOISE, YOU HEAR A SNIFFING SOUND, A BARK, AND A CRASH. THE ORIGIN OF THE SOUND WAS YOUR DOG.")
- time.sleep(1)
- print_now("\n[CONSOLE:] ")
- print_slow("RESPONSE RECORDED AND ANALYZED. LOADING NEXT SCENARIO")
- print_loading("...")
- time.sleep(0.7)
- print_now("\n[CONSOLE:] ")
- print_slow("COMPLETE.")
- time.sleep(1)
- print_now("\n[CONSOLE:] ")
- print_slow("INITIATING SCENARIO_2.")
- time.sleep(1)
- print_fast("\nLOCATION:")
- else:
- if input=="2":
- time.sleep(1)
- print_fast("\nYOU OBTAIN THE FLASHLIGHT FROM YOUR BEDSIDE TABLE.")
- time.sleep(1)
- print_fast("\nAS YOU APPROACH THE SOUND, YOU HEAR A SNIFFING SOUND, A BARK, AND A CRASH. THE ORIGIN OF THE SOUND WAS YOUR DOG.")
- time.sleep(1)
- print_now("\n[CONSOLE:] ")
- print_slow("RESPONSE RECORDED AND ANALYZED. LOADING NEXT QUESTION")
- print_loading("...")
- else:
- if input=="3":
- time.sleep(1)
- print_fast("\nYOU CALL THE POLICE USING YOUR CELL PHONE FROM YOUR BEDSIDE TABLE.")
- time.sleep(1)
- print_fast("\nTHE POLICEMAN ON THE OTHER LINE RESPONDS TO YOUR PANICKED VOICE WHEN YOU HEAR THE NOISE AGAIN AND LISTEN CLOSER.")
- time.sleep(1)
- print_fast("\nAS YOU LISTEN MORE CAREFULLY, YOU HEAR A SNIFFING SOUND, A BARK, AND A CRASHING SOUND. THE ORIGIN OF THE SOUND WAS YOUR DOG.")
- time.sleep(1)
- print_now("\n[CONSOLE:] ")
- print_slow("RESPONSE RECORDED AND ANALYZED. LOADING NEXT QUESTION")
- print_loading("...")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement