Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.78 KB | None | 0 0
  1. #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.
  2. import sys, time
  3.  
  4. #Defining one of the four different speeds of typing. This will primarily be used for printing [CONSOLE:].
  5. def print_now(str):
  6. for letter in str:
  7. sys.stdout.write(letter)
  8. sys.stdout.flush()
  9. time.sleep(0)
  10.  
  11. #Defining one of the four different speeds of typing. This will primarily be used for text before the "CONSOLE" is booted.
  12. def print_fast(str):
  13. for letter in str:
  14. sys.stdout.write(letter)
  15. sys.stdout.flush()
  16. time.sleep(0.05)
  17.  
  18. #Defining one of the four different speeds of typing. This will primarily be used for simulating text printed by the [CONSOLE:].
  19. def print_slow(str):
  20. for letter in str:
  21. sys.stdout.write(letter)
  22. sys.stdout.flush()
  23. time.sleep(0.08)
  24.  
  25. #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.
  26. def print_loading(str):
  27. for letter in str:
  28. sys.stdout.write(letter)
  29. sys.stdout.flush()
  30. time.sleep(0.7)
  31.  
  32. #Creating an indentation between the "run" command that shows up in Python.
  33. '''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")
  34. print_fast("\nHELLO. WELCOME TO TEST 64A2P.")
  35. time.sleep(1)
  36. print_fast("\nIN THIS TEST, YOUR DECISION-MAKING, (VIRTUAL) SITUATIONAL AWARENESS, AND HUMANITY WILL BE ASSESSED.")
  37. time.sleep(1)
  38. print_fast("\nBEFORE WE BEGIN, PLEASE IDENTIFY YOURSELF.")
  39. time.sleep(1)
  40. #Obtaining the user's preferred username.
  41. user = raw_input('\nTEST_SUBJECT: ')
  42. time.sleep(0.5)
  43. print_fast("\nWELCOME, TEST_SUBJECT: " + user + ".")
  44. time.sleep(2)
  45. print_fast("\nTHE TEST WILL NOW BEGIN. BOOTING CONSOLE")
  46. print_loading("...")
  47. time.sleep(1)
  48. #Setting the stage for the kind of program this will be and helping the user to underestand as well. Also simulating realism with [CONSOLE:].
  49. print_now("\n[CONSOLE:] ")
  50. print_slow("BOOT COMPLETE. RUN TEST: TEST_1")
  51. time.sleep(2)
  52. print_now("\n[CONSOLE:] ")
  53. print_slow("TEST_1: SPLIT-SECOND_DECISION-MAKING. LOADING")
  54. print_loading("...")
  55. time.sleep(0.5)
  56. print_now("\n[CONSOLE:] ")
  57. print_slow("COMPLETE. SCENARIO_1: INTRUDER. LOADING")
  58. print_loading("...")
  59. time.sleep(0.5)
  60. print_now("\n[CONSOLE:] ")
  61. print_slow("COMPLETE. TEST BEGINNING IN:")
  62. time.sleep(0.5)
  63. print_now("\n\n[CONSOLE:] ")
  64. print_slow("5")
  65. time.sleep(1)
  66. print_now("\n\n[CONSOLE:] ")
  67. print_slow("4")
  68. time.sleep(1)
  69. print_now("\n\n[CONSOLE:] ")
  70. print_slow("3")
  71. time.sleep(1)
  72. print_now("\n\n[CONSOLE:] ")
  73. print_slow("2")
  74. time.sleep(1)
  75. print_now("\n\n[CONSOLE:] ")
  76. print_slow("1")
  77. time.sleep(1)
  78. print_now("\n\n")
  79. print_now("[CONSOLE:] ")
  80. print_slow("TEST_1 BEGIN. INITIATING SCENARIO_1.")
  81. time.sleep(1)
  82. print_now("\n\n")
  83. print_now("[CONSOLE:] ")
  84. 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.")
  85. time.sleep(1)
  86. print_fast("LOCATION: YOUR RESIDENCE LOCATED IN DETROIT, MICHIGAN.")
  87. time.sleep(1)
  88. 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.")
  89. time.sleep(1)
  90. print_fast("\nINQUIRY: WHAT WOULD YOU DO IN THIS SITUATION?")
  91. time.sleep(1)
  92. print_fast("\nINSTRUCTIONS: PLEASE SELECT YOUR CHOICE BY TYPING 1, 2, OR 3 FOR THE QUESTIONS FOLLOWING THE SITUATION STATEMENT.")
  93. time.sleep(1)
  94. print_fast("\nOPTIONS: (1) ACQUIRE A FIREARM AND INVESTIGATE; (2) ACQUIRE A FLASHLIGHT AND INVESTIGATE; (3) CALL THE POLICE")
  95. time.sleep(1)
  96. print_fast("\nSTATEMENT: YOU HAVE 10 SECONDS TO CHOOSE.")
  97. time.sleep(1)'''
  98. #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.
  99. input=input("PLEASE ENTER YOUR CHOICE: ")
  100.  
  101. if input=="1":
  102. time.sleep(1)
  103. print_fast("\nYOU OBTAIN THE FIREARM FROM YOUR BEDSIDE TABLE.")
  104. time.sleep(1)
  105. 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.")
  106. time.sleep(1)
  107. print_now("\n[CONSOLE:] ")
  108. print_slow("RESPONSE RECORDED AND ANALYZED. LOADING NEXT SCENARIO")
  109. print_loading("...")
  110. time.sleep(0.7)
  111. print_now("\n[CONSOLE:] ")
  112. print_slow("COMPLETE.")
  113. time.sleep(1)
  114. print_now("\n[CONSOLE:] ")
  115. print_slow("INITIATING SCENARIO_2.")
  116. time.sleep(1)
  117. print_fast("\nLOCATION:")
  118. else:
  119.  
  120. if input=="2":
  121. time.sleep(1)
  122. print_fast("\nYOU OBTAIN THE FLASHLIGHT FROM YOUR BEDSIDE TABLE.")
  123. time.sleep(1)
  124. 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.")
  125. time.sleep(1)
  126. print_now("\n[CONSOLE:] ")
  127. print_slow("RESPONSE RECORDED AND ANALYZED. LOADING NEXT QUESTION")
  128. print_loading("...")
  129. else:
  130. if input=="3":
  131. time.sleep(1)
  132. print_fast("\nYOU CALL THE POLICE USING YOUR CELL PHONE FROM YOUR BEDSIDE TABLE.")
  133. time.sleep(1)
  134. print_fast("\nTHE POLICEMAN ON THE OTHER LINE RESPONDS TO YOUR PANICKED VOICE WHEN YOU HEAR THE NOISE AGAIN AND LISTEN CLOSER.")
  135. time.sleep(1)
  136. 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.")
  137. time.sleep(1)
  138. print_now("\n[CONSOLE:] ")
  139. print_slow("RESPONSE RECORDED AND ANALYZED. LOADING NEXT QUESTION")
  140. print_loading("...")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement