Advertisement
makispaiktis

Secret Message

Dec 24th, 2020 (edited)
3,189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 15.35 KB | None | 0 0
  1. from random import randrange
  2. from timeit import default_timer as timer
  3.  
  4.  
  5. # Function 1
  6. def cont(ANSWER):
  7.     flag = True
  8.     if ANSWER.lower() == "yes" or ANSWER.lower() == "sure" or ANSWER.lower() == "of course" or ANSWER.lower() == "why not" or ANSWER.lower() == "yeah":
  9.         flag = True
  10.     elif ANSWER.lower() == "no" or ANSWER.lower() == "no way":
  11.         flag = False
  12.         print("Don't be so negative! I think we have to continue")
  13.     else:
  14.         print("You didn't answer with 'yes' or 'no'. It's a game, so I will translate it as a big 'yes'.")
  15.         flag = False
  16.  
  17.     if flag == True:
  18.         r = randrange(3)
  19.         if r == 0:
  20.             print("Perfect, we continue!")
  21.         elif r == 1:
  22.             print("Nice, let's continue!")
  23.         else:
  24.             print("Great, we keep going!")
  25.     else:
  26.         print("So, we continue and you will not regret it, I promise!")
  27.  
  28.  
  29.  
  30. # Function 2
  31. def convert(seconds):
  32.     seconds = int(seconds)
  33.     minutes = int(seconds / 60)
  34.     secs = seconds - minutes * 60
  35.     return minutes, secs
  36.  
  37.  
  38. # MAIN FUNCTION
  39. START = timer()
  40. print()
  41. print("Merry Christmas dear user! This is a programme to make you smile in your birthday.")
  42. print("It has been designed with much thought and many details, I hope you like it.")
  43. print("Let's focus in the programme. You will use a lot the console in order to gve me input-answers.")
  44. print("Sometimes, the programme will ask you if you want to continue. OF COURSE YOU HAVE")
  45. print("TO REPLY GENTLY giving answers like 'yes', 'sure', 'of course'. Programme needs feedback")
  46. print("to work properly. Also, if you are lucky, the programme may give you some predictions")
  47. print("about the new year 2021. Take it easy and enjoy, it will take 5 mins to be completed.")
  48. print("So, lets start to entertain you.")
  49. print()
  50.  
  51. name = input("Write your full name here: ")
  52. print("Hmmmm nice, I found you in Facebook. I will send you a friend request!")
  53. print()
  54. print("Hello '" + str(name) + "'. I hope you are very good and glad today!")
  55. print("We also know that your first thought after reading the above message maybe was that this 'part' was pretty easy")
  56. print("for you to design it on your own. Real developers understand each other. Let's continue!")
  57. ANSWER = input("Continue? ")
  58. print()
  59. cont(ANSWER)
  60. print()
  61.  
  62. # Variables Space
  63. hits = 0
  64. tries = 0
  65. hits1 = 0
  66. percentage1 = 0
  67.  
  68. # SECTION 1
  69. # PART 1
  70. print("****************************************************************************************")
  71. print("******************************* SECTION 1 **********************************************")
  72. print("****************************************************************************************")
  73. print()
  74. print("* 1a. In your life, you have to smile. Remember that smiling is not the opposite of sadness")
  75. print("Daniel Sloss told it years agooo. What do you want from life? What anyone needs?")
  76. print()
  77. answer = ""
  78. need = input(str(name) + ": I just wanna be: ")
  79. tries += 1
  80. if need.lower() == "happy":
  81.     print("Niiice. Programme thought that happiness is the secret for you dear user. 1/1 correct answers")
  82.     hits1 += 1
  83.     hits += 1
  84. else:
  85.     print("Hmmmmm " + str(answer) +".... Good choice. But the programme guessed that you would say 'happy'! We will continue with this answer.")
  86. answer += "Happy"
  87. print("Answer: " + str(answer))
  88. print()
  89. ANSWER = input("Continue? ")
  90. cont(ANSWER)
  91.  
  92. # PART 2
  93. print()
  94. print("* 1b. Here you have to write down a 2-digit NUMBER. You can think about your answer with 2 ways.")
  95. print("The number we want for input is the HALF of the favourite number of the guy who wrote this code.")
  96. print("If you cannot remember this, I can remind you that you wrote 18.962. Too close to 19K (yposyneidhto)")
  97. number = int(input("Write down the number we are looking for: "))
  98. tries += 1
  99. if number == 19:
  100.     print("I was so sure you had a great memory. It was so clear in the cube-IQ-test! (Code creator laughing)")
  101.     hits1 += 1
  102.     hits += 1
  103. elif number == 38:
  104.     print("38 is the favourite number of the code creator, but we wanted the HALF.")
  105.     print("But, I will give you the point, beacuse you have a great memory. Next time, be more careful hahahaha")
  106.     hits1 += 1
  107.     hits += 1
  108. else:
  109.     print("I hope you miss-clicked. You had 2 evidences to write 19. But don't be sad, its a game!")
  110.     print("Life needs SMILE! Try to be more careful in next questions.")
  111. answer += " 19 "
  112. print("Answer: " + str(answer))
  113. print()
  114. ANSWER = input("Continue? ")
  115. cont(ANSWER)
  116.  
  117. # PART 3
  118. print()
  119. print("* 1c. Last question for section 1. You are 'gata', so maybe you expect something after '19' in answer.")
  120. print("It's time for lexarithms in English. Try to decode the following message.")
  121. print("This one more tricky/difficult from above, you have to think a little bit more...")
  122. print("I want you to write a word after the ciphered message. Don't care about captital letters.")
  123. print("The programmer is too experienced to overcome these problems.")
  124. lexarithm = input("Ciphered message = '1 - 14 - 7 - 9 - 5' ----> Decoded message: ")
  125. tries += 1
  126. print()
  127.  
  128. if lexarithm.lower() == "angie":
  129.     print("One more correct answer. I expected that from you")
  130.     hits1 += 1
  131.     hits += 1
  132. else:
  133.     print("Hmmmm. You have to focus more. You are so clever, you can do it. The correct answer was 'Angie'.")
  134.     print("Maybe, you had entered this name back in the 1st input.")
  135. answer += "Angie"
  136. print("Answer: " + str(answer))
  137. ANSWER = input("Continue? ")
  138. cont(ANSWER)
  139.  
  140. # PART 4
  141. print()
  142. print("One more liiiitle step. Enter a number from 6(inclusive) to 10(inclusive). No much thought required!")
  143. thaym = int(input("Number from 6 to 10: "))
  144. while thaym < 6 or thaym > 10:
  145.     thaym = int(input("Number from 6 to 10: "))
  146. print("You selected " + str(thaym) + ". So, i will put " + str(thaym) + " exclamation marks in answer.")
  147. end = " "
  148. for i in range(thaym):
  149.     end += "!"
  150. answer += end
  151. print("Answer: " + str(answer))
  152. print()
  153. # END 1 - STATISTICS
  154. print("Section 1 has ended. You found " + str(hits1) + " / 3 correct answers. That is amazing. Keep going!" )
  155. ANSWER = input("Continue? ")
  156. cont(ANSWER)
  157. print()
  158. print()
  159.  
  160.  
  161.  
  162.  
  163.  
  164. # SECTION 2
  165. print("****************************************************************************************")
  166. print("******************************* SECTION 2 **********************************************")
  167. print("****************************************************************************************")
  168. print()
  169. print("2. Programme asks you to write down 3 inputs. You have to mention the 3 characteristics ")
  170. print("of your personality. We want 3 aspects of yourself, the 3 that you thought first!")
  171. print("This one is more difficult, but we think we can find some....")
  172. print()
  173. char1 = input("Write down the 1st personality characteristic that you thought: ")
  174. char2 = input("Write down the 2nd personality characteristic that you thought: ")
  175. char3 = input("Write down the 3rd personality characteristic that you thought: ")
  176. print()
  177. characteristics = ["clever", "intelligent", "emotional", "sensitive", "sweet"]
  178. hits2 = 0
  179. chars = [char1, char2, char3]
  180. hits2List = []
  181. for char in chars:
  182.     for characteristic in characteristics:
  183.         if char == characteristic:
  184.             hits2 += 1
  185.             hits2List.append(char)
  186.             hits += 1
  187. tries += 3
  188. print("Niiiice! You found " + str(hits2) + " / 3. My list contained these items: ")
  189. print(characteristics)
  190. print("I know that there are 5 characteristics, but the chars 1-2 and 3-4 are the same!")
  191. print("Points: " + str(hits) + " / " + str(tries))
  192. print()
  193.  
  194.  
  195.  
  196.  
  197.  
  198. # SECTION 3
  199. print("****************************************************************************************")
  200. print("******************************* SECTION 3 **********************************************")
  201. print("****************************************************************************************")
  202. print()
  203. print("3. Now, that you are used to the programme's style, it will be easier to keep going!")
  204. print("This will be a quiz with easy math questions and I want to write down the results/numbers.")
  205. print("I will count how much time did you take to complete the following 3 questions!!!!")
  206. print()
  207. ANSWER = input("Continue? ")
  208. cont(ANSWER)
  209. print()
  210.  
  211. start1 = timer()
  212. n1 = int(input("3a) 25 * 8 = "))
  213. end1 = timer()
  214. secs1 = end1 - start1
  215.  
  216. start2 = timer()
  217. n2 = int(input("3b) If the 1st prime number is 2, then the 5th prime is: "))
  218. end2 = timer()
  219. secs2 = end2 - start2
  220.  
  221. start3 = timer()
  222. n3 = int(input("3c) 15 ^ 2 = "))
  223. end3 = timer()
  224. secs3 = end3 - start3
  225. tries += 3
  226.  
  227. print("Let's see how many correct answers you gave me!")
  228. hits3 = 0
  229. if n1 == 200:
  230.     print("25 * 8 = 200 ----> You are right!")
  231.     hits3 += 1
  232.     hits += 1
  233. else:
  234.     print("In 1st question, you gave me " + str(n1) + ", but: ")
  235.     print("25 * 8 = 200 ----> You are right!")
  236.  
  237. if n2 == 11:
  238.     print("The 5th prime is 11 ----> You are right!")
  239.     hits3 += 1
  240.     hits += 1
  241. else:
  242.     print("In 2nd question, you gave me " + str(n2) + ", but: ")
  243.     print("The 5th prime is 11")
  244.  
  245. if n3 == 225:
  246.     print("15 ^ 2 = 225 ----> You are right!")
  247.     hits3 += 1
  248.     hits += 1
  249. else:
  250.     print("In 3rd question, you gave me " + str(n3) + ", but: ")
  251.     print("15 ^ 2 = 225")
  252.  
  253. print("Fantastic! You found " + str(hits3) + " / 3 correct here.")
  254. elapsed = secs1 + secs2 + secs3
  255. elapsed = round(elapsed, 2)
  256. print("You answered in " + str(elapsed) + " seconds! Very satisfying!")
  257. ANSWER = input("Continue? ")
  258. print()
  259. cont(ANSWER)
  260. print()
  261.  
  262. print("But, the programmer has one more little surprise for you in section 3 of the programme!")
  263. print("You have seen the 3 correct answers. Please 'connect' them to create a 8-digit number with the given row")
  264. date = int(input("If you put all the answers together, what's the created number? "))
  265. tries += 1
  266.  
  267. if date == 20011225:
  268.     hits += 1
  269.     print("Exactly! One more correct answer in your 'bag'!")
  270. else:
  271.     print("I hope you miss-clicked, because you had all the 3 numbers I wanted to concatenate")
  272.     print("The correct answer is: 20011225")
  273. print()
  274. print("So, now im pretty sure that if you focus carefully (Prestige's dialogue was 'look closely'),")
  275. print("you will notice that this number means something for you!")
  276. birth = input("What does this number mean for you? Write 1 single word without referring 'my': ")
  277. tries += 1
  278.  
  279. if birth.lower() == "birthday":
  280.     hits += 1
  281.     print("Yeahhhh! I was sure you are pretty keen on understanding patterns in the numbers!")
  282. else:
  283.     print("20011225 ----> 2001 / 12 / 25 ----> It's your birthday! That was the correct answer!")
  284.     print("Nice try though...")
  285. print()
  286. print("Points: " + str(hits) + " / " + str(tries))
  287. print()
  288. print("And, now we move on to the last section!!!!")
  289. print()
  290. print()
  291.  
  292.  
  293.  
  294.  
  295. # SECTION 4
  296. print("****************************************************************************************")
  297. print("******************************* SECTION 4 **********************************************")
  298. print("****************************************************************************************")
  299. print()
  300. print("4a. Now, I want you to write down your favorite colour: ")
  301. colour = input("Favourite color: ")
  302. tries += 1
  303.  
  304. if colour.lower() == "green":
  305.     hits += 1
  306.     print("Nice. I was sure enough that I remembered this one correctly")
  307. else:
  308.     print("OHHHHHH. I thought that green was your favorite colour!")
  309.     print("I am sorry, now I will remember this forever.....")
  310.     print("But, let's continue with 'green' our test. Of course, you will receive the point,")
  311.     print("because that was my mistake")
  312.     hits += 1
  313.  
  314. print()
  315. print("4b. Back to lexarithms. I want to give me the lexarithm (data type = number) of word 'green'!")
  316. lex = int(input("Lexarithm = "))
  317. tries += 1
  318.  
  319. if lex == 49:
  320.     hits += 1
  321.     print("Nice, lexarithm is 49. I am impressed of your 'adding' abilities hahahaha....")
  322. else:
  323.     print(str(lex) + " is not the correct answer. 49 was the correct one")
  324.  
  325. ANSWER = input("Continue? ")
  326. print()
  327. cont(ANSWER)
  328. print()
  329. print("4c. So, now we know that our number is 49. Let's name this number as 'n' ----> n = 49")
  330. print("Calculate the following calculation!")
  331. calc = int(input("square_root(n) * 17 = "))
  332. tries += 1
  333.  
  334. if calc == 119:
  335.     hits += 1
  336.     print("Nice multiplication! Remember that number")
  337. else:
  338.     print("You could use a computer to calculate: sqrt(49) * 17 = 7 * 17 = 119")
  339.  
  340.  
  341. ANSWER = input("Continue? ")
  342. print()
  343. cont(ANSWER)
  344. print()
  345. print("If, you have made the multiplication correctly, you have a pretty familiar number for you!")
  346. print("I am sure you gave money to find out that number 2 nights before!")
  347. print("I am also sure that maybe you thought about it before the above message, but it doesn't matter.")
  348. print("I want you to write down a single word or 2 words ('KOLLHTA OMWS XWRIS KENA') to tell me what")
  349. print("this number reminded you")
  350. iq = input("4d. What does this remind you " + str(name) + "? ")
  351. tries += 1
  352. print()
  353.  
  354. if iq.lower() == "iq" or iq.lower() == "iqtest" or iq.lower() == "testiq" or iq.lower() == "iq-test" or iq.lower() == "test-iq":
  355.     hits += 1
  356.     print("I knew that you would find out this one quickly")
  357.     print("EDW EKANES 16/20 STOUS PALIOKYBOUS EDW THA KOLLAGES ?!?!?!?!")
  358. else:
  359.     print("I think that you wanted to say something about IQ, but I can't count it as correct answer....")
  360.  
  361. print()
  362. print("Now, it's time for the last question of the test! You have made it fantastic so far!")
  363. print("Let's go back to the beautiful prime numbers. The 1st prime is 2, the 2nd is 3, the 3rd is 5 etc....")
  364. print("Let's call: a = the 14-th prime  and  b = the 15-th prime")
  365. print("I want you to multiplicate them and write down the result! Confirm it with your phone for being 100% sure!")
  366. mult = int(input("a * b = "))
  367. print()
  368. tries += 1
  369.  
  370. if mult == 2021:
  371.     hits += 1
  372.     print("CORRECT AGAIN AND YOU KNOW WHAT I'M GONNA SAY!")
  373. else:
  374.     print("Prime[14] = 43 and Prime[15] = 47, so their product is 43 * 47 = 2021")
  375. print("Now, you see how powerful are the numbers! Who could thought that the only divisors")
  376. print("of the 'new year' are these 2 prime numbers? 43 and 47 seem very strange, but you have")
  377. print("to realise that the beauty and magic things in the nature hide some nice secrets about primes.")
  378. print("If you search more on web, you will 'fall out from the clouds'! HAHAHAHA")
  379.  
  380. ANSWER = input("Continue? ")
  381. print()
  382. cont(ANSWER)
  383. print()
  384. print("Your final score is: ")
  385. print("Points: " + str(hits) + " / " + str(tries))
  386. perc = hits / tries
  387. perc = 100 * perc
  388. perc = round(perc, 2)
  389. print("Correct answer percentage: " + str(perc) + "%")
  390.  
  391. print("One last message from the code creator!!!!")
  392. ANSWER = input("Continue? ")
  393. print()
  394. cont(ANSWER)
  395. print()
  396. END = timer()
  397. seconds = END - START
  398. minutes, secs = convert(seconds)
  399. print("You 'wasted' " + str(minutes) + " minutes and " + str(secs) + " seconds from your life to take this quiz!")
  400. print("I thank you a lot for your time and I hope to make your day happier and entertaining!")
  401. print("I also hope the new year 2021 will be VERY GOOD and BRING YOU WHATEVER you want.")
  402. print("From happiness to successes in every part of your life! I hope you the best")
  403. print("and happy birthday again little '" + str(name) + "' !!!!")
  404. print("I will let you with a song. Copy and paste the link in YouTube! See you and happy birtday again!")
  405. link = "https://www.youtube.com/watch?v=qCJSNMqub8g"
  406. print("Link: " + link)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement