Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- this is the comedy machine.
- """
- # this is for the os.system("cls") func which clears the screen.
- import os
- # this is for the time.sleep() func which pauses the program.
- import time
- # this is for the random.choice() func which randomly selects a joke from the jokelist.
- import random
- # jokeset_func() receives input for the jokeset.
- def jokeset_func():
- jokeset = str(input("how many jokes would you like to generate?: (1-10, codes allowed) "))
- return jokeset
- # rejokeset_func() receives further input for the jokeset for regeneration.
- def rejokeset_func():
- rejokeset = str(input("how many jokes would you like to regenerate?: (1-10, codes allowed) "))
- return rejokeset
- # this is the joke list for if jokeset is from 1-9.
- jokelist = [
- "{jokesub1} hates to work because of {jokeobj1}.",
- "{jokesub1} likes to hit his {jokeobj1} out of nowhere.",
- "{jokesub1}'s {jokeobj1} walks on its own.",
- "the reason {jokesub1} is always late to school is because of a {jokeobj1}.",
- "\"why does {jokesub1} have two {jokeobj1}s? because he's a goblin.\"",
- "{jokesub1} and John walk into a store selling {jokeobj1}s. {jokesub1} bought all of them.",
- "why did {jokesub1} go visit the doctor? because he lost his {jokeobj1}.",
- "{jokesub1} broke his {jokeobj1} because he threw it at a wall.",
- "{jokesub1} tripped over his {jokeobj1}.",
- "{jokesub1} keeps talking to his {jokeobj1}.",
- "the reason {jokesub1} is dead is because he found too many, {jokeobj1}s.",
- "{jokesub1} invested too much money in {jokeobj1}s and wasted his life.",
- "\"wow! that's a lot of {jokeobj1}s! time to call {jokesub1}.\"",
- "\"dude, {jokesub1} is on the news because he stole somebody's {jokeobj1}.\"",
- "{jokesub1} used the washing machine and lost his {jokeobj1}.",
- "why did {jokesub1} cross the road? because there was a lot of {jokeobj1}s on the other side.",
- "can somebody help {jokesub1} locate his {jokeobj1}?",
- "{jokesub1} got too angry so he ate a {jokeobj1}.",
- "1000 {jokesub1}s couldn't stop a {jokeobj1} from rolling down the hill.",
- "{jokesub1} likes bringing his {jokeobj1} to the cinema.",
- "{jokesub1} can't read without {jokeobj1}.",
- "\"{jokesub1} needs to go out more.\" \"but he always takes his {jokeobj1} with him!\"",
- "{jokesub1} can't drive so he installed a {jokeobj1} on his car and crashed.",
- "if {jokesub1} didn't watch television all day, he would've caught the man who stole his {jokeobj1}.",
- "if {jokesub1} could drive he would definitely hit a pedestrian.",
- "the only job {jokesub1} can get is selling {jokeobj1}s.",
- "did you hear about {jokesub1}'s, new diet? it's all {jokeobj1}.",
- "{jokesub1} likes to scam people by pretending to be a {jokeobj1}.",
- "\"why does {jokesub1} always wear a {jokeobj1}?\"",
- "every time {jokesub1} goes to a family reunion, he always gets a {jokeobj1}.",
- "{jokesub1} boils his water with a {jokeobj1}.",
- "{jokesub1}'s dream job is to sell {jokeobj1}s.",
- "{jokesub1} is so poor that he can't afford a {jokeobj1}.",
- "{jokesub1} is always associated with his {jokeobj1} because he literally sleeps with it at night.",
- "{jokesub1} made a fortune by hoarding {jokeobj1}s and selling them online.",
- "{jokesub1} has bad handwriting because he prefers to write with a {jokeobj1}.",
- "if i had a penny for every {jokeobj1} {jokesub1} had, i would have 2 pennies.",
- "{jokesub1} doesn't like it when people hit him with a {jokeobj1}.",
- "{jokesub1} dressed up as a {jokeobj1} for halloween and everyone laughed at him.",
- "{jokesub1} keeps telling us about how his {jokeobj1} is so big.",
- "the amount of {jokeobj1}s {jokesub1} has is the definition of a crapton.",
- "{jokesub1} possesses the ability to build a house using only {jokeobj1}s and nothing more.",
- "{jokeobj1} is {jokesub1}'s, alternative for mouthwash when his financial situation is dire.",
- "did you know that if you traded in a {jokeobj1} you could buy a car?",
- "{jokesub1} waters his {jokeobj1} everyday.",
- ]
- # this is the joke list for if jokeset is 10. it includes adjectives.
- premiumjokelist = [
- "{jokesub1} is always so {jokeadj1} when he sees a {jokeobj1}.",
- "it would be so {jokeadj1} if we gave {jokesub1} a {jokeobj1} for christmas.",
- "{jokesub1} can never be {jokeadj1} if he doesn't get his {jokeobj1}.",
- "the only way to get {jokesub1} when he's {jokeadj1} to shut up is to give him a {jokeobj1}.",
- "why is {jokesub1} so {jokeadj1}? because he has a {jokeobj1}.",
- "if {jokesub1} was a {jokeobj1} he would be {jokeadj1}.",
- "sometimes i wonder if {jokesub1} is a {jokeobj1} because he's so {jokeadj1}.",
- "i think {jokesub1} is a {jokeobj1} because he's so {jokeadj1}.",
- "{jokesub1} is so {jokeadj1} that he can't even see a {jokeobj1}.",
- "{jokesub1} keeps watering his {jokeobj1} and it's getting so {jokeadj1}.",
- "{jokesub1} becomes so {jokeadj1} whenever the tv turns on.",
- "{jokesub1} is so {jokeadj1} that even {jokeobj1} feels embarrassed."
- "why does {jokesub1} always look so {jokeadj1}? it's because {jokeobj1} told them to.",
- "the {jokeadj1} {jokesub1} couldn't find {jokeobj1} in a million years.",
- "I saw {jokesub1} trying to talk to {jokeobj1}, but they were too {jokeadj1} to respond.",
- "{jokesub1} is so {jokeadj1}, even {jokeobj1} can't handle it.",
- "did you hear about the {jokeadj1} {jokesub1}? {jokeobj1} couldn't believe it!",
- "{jokesub1} and {jokeobj1} had the most {jokeadj1} conversation ever.",
- "if {jokesub1} wasn't so {jokeadj1}, maybe {jokeobj1} would hang out with them.",
- "why did {jokesub1} cross the road? Because they were too {jokeadj1} to talk to {jokeobj1}.",
- "{jokesub1} is always {jokeadj1}, especially around {jokeobj1}.",
- "{jokesub1} thought they were {jokeadj1}, but {jokeobj1} proved them wrong.",
- "Even {jokeobj1} knows {jokesub1} is too {jokeadj1} to be taken seriously.",
- "If {jokesub1} wasn't so {jokeadj1}, they would probably understand {jokeobj1}.",
- "{jokesub1} is {jokeadj1} enough to think {jokeobj1} is their best friend.",
- "when {jokesub1} tried to impress {jokeobj1}, it was just {jokeadj1}.",
- "rumor has it, {jokesub1} is {jokeadj1} because of {jokeobj1}.",
- "The {jokeadj1} {jokesub1} couldn't stop staring at {jokeobj1}.",
- "When {jokesub1} and {jokeobj1} met, it was the most {jokeadj1} encounter ever.",
- "{jokesub1} tried to borrow {jokeobj1}, but they were too {jokeadj1} to ask.",
- "They say {jokesub1} is as {jokeadj1} as {jokeobj1}.",
- "Every time {jokesub1} talks to {jokeobj1}, it gets more {jokeadj1}.",
- "{jokesub1} is so {jokeadj1}, even {jokeobj1} is impressed.",
- "Why is {jokesub1} always so {jokeadj1}? Probably because of {jokeobj1}.",
- "You know things are bad when {jokeobj1} thinks {jokesub1} is {jokeadj1}.",
- "If {jokesub1} wasn't so {jokeadj1}, they might have noticed {jokeobj1} sooner.",
- "{jokesub1} was feeling {jokeadj1}, but {jokeobj1} didn't care.",
- "Whenever {jokesub1} is around {jokeobj1}, things get {jokeadj1}.",
- "{jokesub1} and {jokeobj1} make a {jokeadj1} team.",
- "If {jokesub1} wasn't so {jokeadj1}, maybe {jokeobj1} wouldn't be so annoyed.",
- "{jokesub1} tried to hide their {jokeadj1} side, but {jokeobj1} saw right through it.",
- "{jokesub1} is {jokeadj1} because {jokeobj1} keeps bothering them.",
- "{jokesub1} would be less {jokeadj1} if {jokeobj1} just went away.",
- "The {jokeadj1} {jokesub1} can't stand {jokeobj1}.",
- "{jokesub1} is so {jokeadj1}, they can't even talk to {jokeobj1}.",
- "Even {jokeobj1} couldn't believe how {jokeadj1} {jokesub1} was acting.",
- "{jokesub1} was too {jokeadj1} to understand what {jokeobj1} meant.",
- "{jokesub1} and {jokeobj1} together? That's just {jokeadj1}.",
- "{jokesub1} is {jokeadj1}, and it's all because of {jokeobj1}.",
- "When {jokesub1} tried to impress {jokeobj1}, they were too {jokeadj1} to succeed.",
- "{jokesub1} thinks they're {jokeadj1}, but {jokeobj1} knows better.",
- "whenever {jokesub1} tries to talk to {jokeobj1}, it gets too {jokeadj1}.",
- "{jokesub1} was too {jokeadj1} to realize {jokeobj1} was standing right there.",
- "{jokesub1} tried to be {jokeadj1}, but {jokeobj1} laughed at them.",
- "{jokesub1} and {jokeobj1} have the most {jokeadj1} relationship.",
- "{jokesub1} couldn't believe how {jokeadj1} {jokeobj1} was acting.",
- "whenever {jokesub1} is with {jokeobj1}, things get {jokeadj1} fast.",
- "{jokesub1} feels so {jokeadj1} every time {jokeobj1} is mentioned.",
- ]
- """
- this is the jokemaker for if jokeset is from 1-9. it takes random jokes from the jokelist and
- replaces the variables with the user's input.
- """
- def jokemaker():
- global jokesub1, jokeobj1
- joketemp = random.choice(jokelist)
- joke = joketemp.replace("{jokesub1}", jokesub1).replace("{jokeobj1}", jokeobj1)
- return joke
- # this is the jokemaker for if jokeset is 10. it works the same as jokemaker().
- def premiumjokemaker():
- global jokesub1, jokeobj1, jokeadj1
- joketemp = random.choice(premiumjokelist)
- joke = joketemp.replace("{jokesub1}", jokesub1).replace("{jokeobj1}", jokeobj1).replace("{jokeadj1}", jokeadj1)
- return joke
- # refirststage() houses all the jokes and jokesets for regeneration if humorlvl is set to 1.
- def refirststage():
- global jokesub1, jokeobj1, jokeadj1
- # this defines rejokeset so that it can be converted to an int.
- rejokeset = rejokeset_func()
- try:
- rejokeset_int = int(rejokeset)
- except ValueError:
- rejokeset_int = None
- if rejokeset_int is None:
- print("invalid code")
- refirststage()
- # this is the error message for if the user inputs a number that is not between 1 and 10.
- if rejokeset_int is not None and rejokeset_int < 0 or rejokeset_int > 10:
- print("please input a number from 1-10.")
- refirststage()
- # this is the regeneration for if jokeset is from 1-9.
- elif rejokeset_int is not None and rejokeset_int >= 1 and rejokeset_int < 10:
- print("great")
- time.sleep(0.5)
- jokesub1 = str(input("enter a subject: "))
- jokeobj1 = str(input("enter an object: "))
- print("great")
- time.sleep(0.5)
- verification01 = str(input("would you like to generate the jokes? (y/n) "))
- if verification01 == "n":
- firststage()
- if verification01 == "y":
- for i in range(rejokeset_int):
- joke = jokemaker()
- print(joke)
- time.sleep(0.2)
- verification001 = str(input("would you like to regenerate the jokes?: (y/n) "))
- if verification001 == "y":
- refirststage()
- if verification001 == "n":
- print("thank you for using the comedy machine.")
- time.sleep(1)
- os.system("cls")
- print("the comedy machine will always return.")
- time.sleep(1)
- exit()
- else:
- print("please choose between y or n.")
- # this is the regeneration for if jokeset is 10.
- elif rejokeset_int is not None and rejokeset_int == 10:
- print("great")
- time.sleep(0.5)
- jokesub1 = str(input("enter a subject: "))
- jokeobj1 = str(input("enter an object: "))
- jokeadj1 = str(input("enter an adjective: "))
- print("great")
- time.sleep(0.5)
- verification01 = str(input("would you like to generate the jokes?: (y/n) "))
- if verification01 == "n":
- firststage()
- if verification01 == "y":
- for i in range(rejokeset_int):
- joke = premiumjokemaker()
- print(joke)
- time.sleep(0.2)
- verification001 = str(input("would you like to regenerate the jokes?: (y/n) "))
- if verification001 == "y":
- refirststage()
- if verification001 == "n":
- print("thank you for using the comedy machine.")
- time.sleep(1)
- os.system("cls")
- print("the comedy machine will always return.")
- time.sleep(1)
- exit()
- else:
- print("please choose between y or n.")
- # firststage() houses all the jokes and jokesets for generation if humorlvl is set to 1.
- def firststage():
- global jokesub1, jokeobj1, jokeadj1
- # this defines jokeset so that it can be converted to an int.
- jokeset = jokeset_func()
- try:
- jokeset_int = int(jokeset)
- except ValueError:
- jokeset_int = None
- # this is the error messsage for if the user doesn't input a number or a valid code.
- if jokeset_int is None:
- print("invalid code")
- firststage()
- # this is the error message for if the user inputs a number that is not between 1 and 10.
- if jokeset_int is not None and jokeset_int < 0 or jokeset_int > 10:
- print("please input a number from 1-10.")
- firststage()
- elif jokeset_int is not None and jokeset_int >= 1 and jokeset_int < 10:
- print("great")
- time.sleep(0.5)
- jokesub1 = str(input("enter a subject: "))
- jokeobj1 = str(input("enter an object: "))
- print("great")
- time.sleep(0.5)
- verification01 = str(input("would you like to generate the jokes? (y/n) "))
- if verification01 == "n":
- firststage()
- if verification01 == "y":
- for i in range(jokeset_int):
- joke = jokemaker()
- print(joke)
- time.sleep(0.2)
- verification001 = str(input("would you like to regenerate the jokes?: (y/n) "))
- if verification001 == "y":
- refirststage()
- if verification001 == "n":
- print("thank you for using the comedy machine.")
- time.sleep(1)
- os.system("cls")
- print("the comedy machine will always return.")
- time.sleep(1)
- exit()
- else:
- print("please choose between y or n.")
- # this is the generation for if jokeset is 10.
- elif jokeset_int is not None and jokeset_int == 10:
- print("great")
- time.sleep(0.5)
- jokesub1 = str(input("enter a subject: "))
- jokeobj1 = str(input("enter an object: "))
- jokeadj1 = str(input("enter an adjective: "))
- print("great")
- time.sleep(0.5)
- verification01 = str(input("would you like to generate the jokes?: (y/n) "))
- if verification01 == "n":
- refirststage()
- if verification01 == "y":
- for i in range(jokeset_int):
- joke = premiumjokemaker()
- print(joke)
- time.sleep(0.2)
- verification001 = str(input("would you like to regenerate the jokes?: (y/n) "))
- if verification001 == "y":
- refirststage()
- if verification001 == "n":
- print("thank you for using the comedy machine.")
- time.sleep(1)
- os.system("cls")
- print("the comedy machine will always return.")
- time.sleep(1)
- exit()
- else:
- print("please choose between y or n.")
- def switch():
- verification0 = str(input("would you like to start the comedy machine? (y/n) "))
- if verification0 == "n":
- exit()
- if verification0 == "y":
- # humorset_func()
- os.system("cls")
- firststage()
- else:
- print("please choose between y or n.")
- switch()
- # this is the beginning of the program.
- print ("comedy machine v1.0")
- print ("by aiden h")
- switch()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement