Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- print("Welcome to a fun word replacement game.")
- try:
- fileCheck = input("Enter the name of the file to use:\n")
- fileBoi = open(fileCheck, 'r')
- except:
- print("Error Bad File Name")
- sys.exit(0)
- if fileCheck == 'example1.txt':
- try:
- checkName = input("Please give a name\n")
- except:
- if checkName == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkPlace = input("Please give a place\n")
- except:
- if checkPlace == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkDay = input("Please give a day of the week\n")
- except:
- if checkDay == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkTime = input("Please give a time\n")
- except:
- if checkTime == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkVerb = input("Please give a verb\n")
- except:
- if checkVerb == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkAnimal = input("Please give an animal\n")
- except:
- if checkAnimal == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkBodyPart = input("Please give a body part\n")
- except:
- if checkBodyPart == False:
- print("Error Word Not Valid")
- sys.exit(0)
- print("Here is your story:")
- print("--------------------")
- print("%s is having a party! It's going to be at %s on %s. Please make sure to show up at %s, or else you will be required to %s a/an %s with your %s." % (checkName, checkPlace, checkDay, checkTime, checkVerb, checkAnimal, checkBodyPart))
- else:
- pass
- ###just wanted to take this time to let the TA's know that they are beautiful :)###
- if fileCheck == 'example2.txt':
- try:
- checkNounOne = input("Please give a noun\n")
- except:
- if checkNounOne == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkAdjOne = input("Please give an adjective\n")
- except:
- if checkAdjOne == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkNounTwo = input("Please give a noun\n")
- except:
- if checkNounTwo == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkNounThree = input("Please give a noun\n")
- except:
- if checkNounThree == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkAdjTwo = input("Please give an adjective\n")
- except:
- if checkAdjTwo == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkAdjThree = input("Please give an adjective\n")
- except:
- if checkAdjThree == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkAdjFour = input("Please give an adjective\n")
- except:
- if checkAdjectFour == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkNounFour = input("Please give a noun\n")
- except:
- if checkNounFour == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkNounFive = input("Please give a noun\n")
- except:
- if checkNounFive == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkAdjFive = input("Please give an adjective\n")
- except:
- if checkAdjectFive == False:
- print("Error Word Not Valid")
- sys.exit(0)
- print("Here is your story:")
- print("--------------------")
- print("Weather plays an important part in our %s everyday. What is weather you ask? According to %s scientists, who are known as meteorologists, weather is what the %s is like at any time of the %s. It doesn't matter if the air is %s or %s, it's all weather. When vapors in %s clouds condense, we have %s and snow. A lot of %s means a %s snowstorm!" % (checkNounOne, checkAdjOne, checkNounTwo, checkNounThree, checkAdjTwo, checkAdjThree, checkAdjFour, checkNounFour, checkNounFive, checkAdjFive))
- else:
- pass
- ### another reminder that you are an amazing person C; ###
- if fileCheck == 'mad_lib.txt':
- try:
- checkAdjOne = input("Please give an adjective\n")
- except:
- if checkAdjOne == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkAdjTwo = input("Please give an adjective\n")
- except:
- if checkAdjTwo == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkNounOne = input("Please give a noun\n")
- except:
- if checkNounOne == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkNounTwo = input("Please give a noun\n")
- except:
- if checkNounTwo == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkPluralOne = input("Please give a plural noun\n")
- except:
- if checkPluralOne == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkGame = input("Please give a game\n")
- except:
- if checkGame == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkPluralTwo = input("Please give a plural noun\n")
- except:
- if checkPluralTwo == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkVerbOne = input("Please give a verb ending in ing\n")
- except:
- if checkVerbOne == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkVerbTwo = input("Please give a verb ending in ing\n")
- except:
- if checkVerbTwo == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkPluralThree = input("Please give a plural noun\n")
- except:
- if checkPluralThree == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkVerbThree = input("Please give a verb ending in ing\n")
- except:
- if checkVerbThree == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkNounThree = input("Please give a noun\n")
- except:
- if checkNounThree == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkPlant = input("Please give a plant\n")
- except:
- if checkPlant == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkBody = input("Please give a part of the body\n")
- except:
- if checkBody == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkPlace = input("Please give a place\n")
- except:
- if checkPlace == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkVerbFour = input("Please give a verb ending in ing\n")
- except:
- if checkVerbFour== False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkAdjThree = input("Please give an adjective\n")
- except:
- if checkAdjThree == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkNumber = input("Please give a number\n")
- except:
- if checkNumber == False:
- print("Error Word Not Valid")
- sys.exit(0)
- try:
- checkPluralFour = input("Please give a plural noun\n")
- except:
- if checkPluralFour == False:
- print("Error Word Not Valid")
- sys.exit(0)
- print("Here is your story:")
- print("--------------------")
- print("A vacation is when you take a trip to some %s place with your %s family. Usually you go to some place that is near a/an %s or up on a/an %s. A good vacation place is one where you can ride %s or play %s or go hunting for %s. I like to spend my time %s or %s. When parent go on a vacation, they spend their time eating three %s a day, and fathers play golf, and mothers sit around %s. Last summer, my little brother fell in a/an %s and got poison %s all over his %s. My family is going to go to (the) %s, and I will practice %s. Parents need vacations more than kids because parents are always very %s and because they have to work %s hours every day all year making enough %s to pay for the vacation." % (checkAdjOne, checkAdjTwo, checkNounOne, checkNounTwo, checkPluralOne, checkGame, checkPluralTwo, checkVerbOne, checkVerbTwo, checkPluralThree, checkVerbThree, checkNounThree, checkPlant, checkBody, checkPlace, checkVerbFour, checkAdjThree, checkNumber, checkPluralFour))
- else:
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement