Advertisement
aho86

fusion one - comedy machine v1.0

Oct 25th, 2024 (edited)
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.74 KB | Software | 0 0
  1. """
  2. this is the comedy machine.
  3. """
  4.  
  5. # this is for the os.system("cls") func which clears the screen.
  6. import os
  7. # this is for the time.sleep() func which pauses the program.
  8. import time
  9. # this is for the random.choice() func which randomly selects a joke from the jokelist.
  10. import random
  11.  
  12. # jokeset_func() receives input for the jokeset.
  13. def jokeset_func():
  14. jokeset = str(input("how many jokes would you like to generate?: (1-10, codes allowed) "))
  15. return jokeset
  16. # rejokeset_func() receives further input for the jokeset for regeneration.
  17. def rejokeset_func():
  18. rejokeset = str(input("how many jokes would you like to regenerate?: (1-10, codes allowed) "))
  19. return rejokeset
  20.  
  21. # this is the joke list for if jokeset is from 1-9.
  22. jokelist = [
  23. "{jokesub1} hates to work because of {jokeobj1}.",
  24. "{jokesub1} likes to hit his {jokeobj1} out of nowhere.",
  25. "{jokesub1}'s {jokeobj1} walks on its own.",
  26. "the reason {jokesub1} is always late to school is because of a {jokeobj1}.",
  27. "\"why does {jokesub1} have two {jokeobj1}s? because he's a goblin.\"",
  28. "{jokesub1} and John walk into a store selling {jokeobj1}s. {jokesub1} bought all of them.",
  29. "why did {jokesub1} go visit the doctor? because he lost his {jokeobj1}.",
  30. "{jokesub1} broke his {jokeobj1} because he threw it at a wall.",
  31. "{jokesub1} tripped over his {jokeobj1}.",
  32. "{jokesub1} keeps talking to his {jokeobj1}.",
  33. "the reason {jokesub1} is dead is because he found too many, {jokeobj1}s.",
  34. "{jokesub1} invested too much money in {jokeobj1}s and wasted his life.",
  35. "\"wow! that's a lot of {jokeobj1}s! time to call {jokesub1}.\"",
  36. "\"dude, {jokesub1} is on the news because he stole somebody's {jokeobj1}.\"",
  37. "{jokesub1} used the washing machine and lost his {jokeobj1}.",
  38. "why did {jokesub1} cross the road? because there was a lot of {jokeobj1}s on the other side.",
  39. "can somebody help {jokesub1} locate his {jokeobj1}?",
  40. "{jokesub1} got too angry so he ate a {jokeobj1}.",
  41. "1000 {jokesub1}s couldn't stop a {jokeobj1} from rolling down the hill.",
  42. "{jokesub1} likes bringing his {jokeobj1} to the cinema.",
  43. "{jokesub1} can't read without {jokeobj1}.",
  44. "\"{jokesub1} needs to go out more.\" \"but he always takes his {jokeobj1} with him!\"",
  45. "{jokesub1} can't drive so he installed a {jokeobj1} on his car and crashed.",
  46. "if {jokesub1} didn't watch television all day, he would've caught the man who stole his {jokeobj1}.",
  47. "if {jokesub1} could drive he would definitely hit a pedestrian.",
  48. "the only job {jokesub1} can get is selling {jokeobj1}s.",
  49. "did you hear about {jokesub1}'s, new diet? it's all {jokeobj1}.",
  50. "{jokesub1} likes to scam people by pretending to be a {jokeobj1}.",
  51. "\"why does {jokesub1} always wear a {jokeobj1}?\"",
  52. "every time {jokesub1} goes to a family reunion, he always gets a {jokeobj1}.",
  53. "{jokesub1} boils his water with a {jokeobj1}.",
  54. "{jokesub1}'s dream job is to sell {jokeobj1}s.",
  55. "{jokesub1} is so poor that he can't afford a {jokeobj1}.",
  56. "{jokesub1} is always associated with his {jokeobj1} because he literally sleeps with it at night.",
  57. "{jokesub1} made a fortune by hoarding {jokeobj1}s and selling them online.",
  58. "{jokesub1} has bad handwriting because he prefers to write with a {jokeobj1}.",
  59. "if i had a penny for every {jokeobj1} {jokesub1} had, i would have 2 pennies.",
  60. "{jokesub1} doesn't like it when people hit him with a {jokeobj1}.",
  61. "{jokesub1} dressed up as a {jokeobj1} for halloween and everyone laughed at him.",
  62. "{jokesub1} keeps telling us about how his {jokeobj1} is so big.",
  63. "the amount of {jokeobj1}s {jokesub1} has is the definition of a crapton.",
  64. "{jokesub1} possesses the ability to build a house using only {jokeobj1}s and nothing more.",
  65. "{jokeobj1} is {jokesub1}'s, alternative for mouthwash when his financial situation is dire.",
  66. "did you know that if you traded in a {jokeobj1} you could buy a car?",
  67. "{jokesub1} waters his {jokeobj1} everyday.",
  68. ]
  69.  
  70. # this is the joke list for if jokeset is 10. it includes adjectives.
  71. premiumjokelist = [
  72. "{jokesub1} is always so {jokeadj1} when he sees a {jokeobj1}.",
  73. "it would be so {jokeadj1} if we gave {jokesub1} a {jokeobj1} for christmas.",
  74. "{jokesub1} can never be {jokeadj1} if he doesn't get his {jokeobj1}.",
  75. "the only way to get {jokesub1} when he's {jokeadj1} to shut up is to give him a {jokeobj1}.",
  76. "why is {jokesub1} so {jokeadj1}? because he has a {jokeobj1}.",
  77. "if {jokesub1} was a {jokeobj1} he would be {jokeadj1}.",
  78. "sometimes i wonder if {jokesub1} is a {jokeobj1} because he's so {jokeadj1}.",
  79. "i think {jokesub1} is a {jokeobj1} because he's so {jokeadj1}.",
  80. "{jokesub1} is so {jokeadj1} that he can't even see a {jokeobj1}.",
  81. "{jokesub1} keeps watering his {jokeobj1} and it's getting so {jokeadj1}.",
  82. "{jokesub1} becomes so {jokeadj1} whenever the tv turns on.",
  83. "{jokesub1} is so {jokeadj1} that even {jokeobj1} feels embarrassed."
  84. "why does {jokesub1} always look so {jokeadj1}? it's because {jokeobj1} told them to.",
  85. "the {jokeadj1} {jokesub1} couldn't find {jokeobj1} in a million years.",
  86. "I saw {jokesub1} trying to talk to {jokeobj1}, but they were too {jokeadj1} to respond.",
  87. "{jokesub1} is so {jokeadj1}, even {jokeobj1} can't handle it.",
  88. "did you hear about the {jokeadj1} {jokesub1}? {jokeobj1} couldn't believe it!",
  89. "{jokesub1} and {jokeobj1} had the most {jokeadj1} conversation ever.",
  90. "if {jokesub1} wasn't so {jokeadj1}, maybe {jokeobj1} would hang out with them.",
  91. "why did {jokesub1} cross the road? Because they were too {jokeadj1} to talk to {jokeobj1}.",
  92. "{jokesub1} is always {jokeadj1}, especially around {jokeobj1}.",
  93. "{jokesub1} thought they were {jokeadj1}, but {jokeobj1} proved them wrong.",
  94. "Even {jokeobj1} knows {jokesub1} is too {jokeadj1} to be taken seriously.",
  95. "If {jokesub1} wasn't so {jokeadj1}, they would probably understand {jokeobj1}.",
  96. "{jokesub1} is {jokeadj1} enough to think {jokeobj1} is their best friend.",
  97. "when {jokesub1} tried to impress {jokeobj1}, it was just {jokeadj1}.",
  98. "rumor has it, {jokesub1} is {jokeadj1} because of {jokeobj1}.",
  99. "The {jokeadj1} {jokesub1} couldn't stop staring at {jokeobj1}.",
  100. "When {jokesub1} and {jokeobj1} met, it was the most {jokeadj1} encounter ever.",
  101. "{jokesub1} tried to borrow {jokeobj1}, but they were too {jokeadj1} to ask.",
  102. "They say {jokesub1} is as {jokeadj1} as {jokeobj1}.",
  103. "Every time {jokesub1} talks to {jokeobj1}, it gets more {jokeadj1}.",
  104. "{jokesub1} is so {jokeadj1}, even {jokeobj1} is impressed.",
  105. "Why is {jokesub1} always so {jokeadj1}? Probably because of {jokeobj1}.",
  106. "You know things are bad when {jokeobj1} thinks {jokesub1} is {jokeadj1}.",
  107. "If {jokesub1} wasn't so {jokeadj1}, they might have noticed {jokeobj1} sooner.",
  108. "{jokesub1} was feeling {jokeadj1}, but {jokeobj1} didn't care.",
  109. "Whenever {jokesub1} is around {jokeobj1}, things get {jokeadj1}.",
  110. "{jokesub1} and {jokeobj1} make a {jokeadj1} team.",
  111. "If {jokesub1} wasn't so {jokeadj1}, maybe {jokeobj1} wouldn't be so annoyed.",
  112. "{jokesub1} tried to hide their {jokeadj1} side, but {jokeobj1} saw right through it.",
  113. "{jokesub1} is {jokeadj1} because {jokeobj1} keeps bothering them.",
  114. "{jokesub1} would be less {jokeadj1} if {jokeobj1} just went away.",
  115. "The {jokeadj1} {jokesub1} can't stand {jokeobj1}.",
  116. "{jokesub1} is so {jokeadj1}, they can't even talk to {jokeobj1}.",
  117. "Even {jokeobj1} couldn't believe how {jokeadj1} {jokesub1} was acting.",
  118. "{jokesub1} was too {jokeadj1} to understand what {jokeobj1} meant.",
  119. "{jokesub1} and {jokeobj1} together? That's just {jokeadj1}.",
  120. "{jokesub1} is {jokeadj1}, and it's all because of {jokeobj1}.",
  121. "When {jokesub1} tried to impress {jokeobj1}, they were too {jokeadj1} to succeed.",
  122. "{jokesub1} thinks they're {jokeadj1}, but {jokeobj1} knows better.",
  123. "whenever {jokesub1} tries to talk to {jokeobj1}, it gets too {jokeadj1}.",
  124. "{jokesub1} was too {jokeadj1} to realize {jokeobj1} was standing right there.",
  125. "{jokesub1} tried to be {jokeadj1}, but {jokeobj1} laughed at them.",
  126. "{jokesub1} and {jokeobj1} have the most {jokeadj1} relationship.",
  127. "{jokesub1} couldn't believe how {jokeadj1} {jokeobj1} was acting.",
  128. "whenever {jokesub1} is with {jokeobj1}, things get {jokeadj1} fast.",
  129. "{jokesub1} feels so {jokeadj1} every time {jokeobj1} is mentioned.",
  130. ]
  131.  
  132. """
  133. this is the jokemaker for if jokeset is from 1-9. it takes random jokes from the jokelist and
  134. replaces the variables with the user's input.
  135. """
  136. def jokemaker():
  137. global jokesub1, jokeobj1
  138. joketemp = random.choice(jokelist)
  139. joke = joketemp.replace("{jokesub1}", jokesub1).replace("{jokeobj1}", jokeobj1)
  140. return joke
  141.  
  142. # this is the jokemaker for if jokeset is 10. it works the same as jokemaker().
  143. def premiumjokemaker():
  144. global jokesub1, jokeobj1, jokeadj1
  145. joketemp = random.choice(premiumjokelist)
  146. joke = joketemp.replace("{jokesub1}", jokesub1).replace("{jokeobj1}", jokeobj1).replace("{jokeadj1}", jokeadj1)
  147. return joke
  148.  
  149. # refirststage() houses all the jokes and jokesets for regeneration if humorlvl is set to 1.
  150. def refirststage():
  151. global jokesub1, jokeobj1, jokeadj1
  152. # this defines rejokeset so that it can be converted to an int.
  153. rejokeset = rejokeset_func()
  154. try:
  155. rejokeset_int = int(rejokeset)
  156. except ValueError:
  157. rejokeset_int = None
  158.  
  159. if rejokeset_int is None:
  160. print("invalid code")
  161. refirststage()
  162. # this is the error message for if the user inputs a number that is not between 1 and 10.
  163. if rejokeset_int is not None and rejokeset_int < 0 or rejokeset_int > 10:
  164. print("please input a number from 1-10.")
  165. refirststage()
  166.  
  167. # this is the regeneration for if jokeset is from 1-9.
  168. elif rejokeset_int is not None and rejokeset_int >= 1 and rejokeset_int < 10:
  169. print("great")
  170. time.sleep(0.5)
  171. jokesub1 = str(input("enter a subject: "))
  172. jokeobj1 = str(input("enter an object: "))
  173. print("great")
  174. time.sleep(0.5)
  175. verification01 = str(input("would you like to generate the jokes? (y/n) "))
  176. if verification01 == "n":
  177. firststage()
  178. if verification01 == "y":
  179. for i in range(rejokeset_int):
  180. joke = jokemaker()
  181. print(joke)
  182. time.sleep(0.2)
  183. verification001 = str(input("would you like to regenerate the jokes?: (y/n) "))
  184. if verification001 == "y":
  185. refirststage()
  186. if verification001 == "n":
  187. print("thank you for using the comedy machine.")
  188. time.sleep(1)
  189. os.system("cls")
  190. print("the comedy machine will always return.")
  191. time.sleep(1)
  192. exit()
  193. else:
  194. print("please choose between y or n.")
  195.  
  196.  
  197. # this is the regeneration for if jokeset is 10.
  198. elif rejokeset_int is not None and rejokeset_int == 10:
  199. print("great")
  200. time.sleep(0.5)
  201. jokesub1 = str(input("enter a subject: "))
  202. jokeobj1 = str(input("enter an object: "))
  203. jokeadj1 = str(input("enter an adjective: "))
  204. print("great")
  205. time.sleep(0.5)
  206. verification01 = str(input("would you like to generate the jokes?: (y/n) "))
  207. if verification01 == "n":
  208. firststage()
  209. if verification01 == "y":
  210. for i in range(rejokeset_int):
  211. joke = premiumjokemaker()
  212. print(joke)
  213. time.sleep(0.2)
  214. verification001 = str(input("would you like to regenerate the jokes?: (y/n) "))
  215. if verification001 == "y":
  216. refirststage()
  217. if verification001 == "n":
  218. print("thank you for using the comedy machine.")
  219. time.sleep(1)
  220. os.system("cls")
  221. print("the comedy machine will always return.")
  222. time.sleep(1)
  223. exit()
  224. else:
  225. print("please choose between y or n.")
  226.  
  227. # firststage() houses all the jokes and jokesets for generation if humorlvl is set to 1.
  228. def firststage():
  229. global jokesub1, jokeobj1, jokeadj1
  230. # this defines jokeset so that it can be converted to an int.
  231. jokeset = jokeset_func()
  232. try:
  233. jokeset_int = int(jokeset)
  234. except ValueError:
  235. jokeset_int = None
  236. # this is the error messsage for if the user doesn't input a number or a valid code.
  237. if jokeset_int is None:
  238. print("invalid code")
  239. firststage()
  240. # this is the error message for if the user inputs a number that is not between 1 and 10.
  241. if jokeset_int is not None and jokeset_int < 0 or jokeset_int > 10:
  242. print("please input a number from 1-10.")
  243. firststage()
  244.  
  245. elif jokeset_int is not None and jokeset_int >= 1 and jokeset_int < 10:
  246. print("great")
  247. time.sleep(0.5)
  248. jokesub1 = str(input("enter a subject: "))
  249. jokeobj1 = str(input("enter an object: "))
  250. print("great")
  251. time.sleep(0.5)
  252. verification01 = str(input("would you like to generate the jokes? (y/n) "))
  253. if verification01 == "n":
  254. firststage()
  255. if verification01 == "y":
  256. for i in range(jokeset_int):
  257. joke = jokemaker()
  258. print(joke)
  259. time.sleep(0.2)
  260. verification001 = str(input("would you like to regenerate the jokes?: (y/n) "))
  261. if verification001 == "y":
  262. refirststage()
  263. if verification001 == "n":
  264. print("thank you for using the comedy machine.")
  265. time.sleep(1)
  266. os.system("cls")
  267. print("the comedy machine will always return.")
  268. time.sleep(1)
  269. exit()
  270. else:
  271. print("please choose between y or n.")
  272.  
  273. # this is the generation for if jokeset is 10.
  274. elif jokeset_int is not None and jokeset_int == 10:
  275. print("great")
  276. time.sleep(0.5)
  277. jokesub1 = str(input("enter a subject: "))
  278. jokeobj1 = str(input("enter an object: "))
  279. jokeadj1 = str(input("enter an adjective: "))
  280. print("great")
  281. time.sleep(0.5)
  282. verification01 = str(input("would you like to generate the jokes?: (y/n) "))
  283. if verification01 == "n":
  284. refirststage()
  285. if verification01 == "y":
  286. for i in range(jokeset_int):
  287. joke = premiumjokemaker()
  288. print(joke)
  289. time.sleep(0.2)
  290. verification001 = str(input("would you like to regenerate the jokes?: (y/n) "))
  291. if verification001 == "y":
  292. refirststage()
  293. if verification001 == "n":
  294. print("thank you for using the comedy machine.")
  295. time.sleep(1)
  296. os.system("cls")
  297. print("the comedy machine will always return.")
  298. time.sleep(1)
  299. exit()
  300. else:
  301. print("please choose between y or n.")
  302. def switch():
  303. verification0 = str(input("would you like to start the comedy machine? (y/n) "))
  304. if verification0 == "n":
  305. exit()
  306. if verification0 == "y":
  307. # humorset_func()
  308. os.system("cls")
  309. firststage()
  310. else:
  311. print("please choose between y or n.")
  312. switch()
  313.  
  314. # this is the beginning of the program.
  315. print ("comedy machine v1.0")
  316. print ("by aiden h")
  317. switch()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement