This course will become read-only in the near future. Tell us at community.p2pu.org if that is a problem.

Get creative and write your own MadLib


Here's your chance to get creative! Using the things you've learned throughout this challenge, write your own MadLib!

1. Open Wing IDE and create a new file.

2. You may want to plan your story out on paper first - what variables will you need?

3. You may choose to start by writing the code for getting information from the player first, or by writing the story first.

4. If you have trouble with the code, try using Google to figure out your problems. Or, you can ask your questions in the discussion area below.

5. When you're done, copy and paste the code for your MadLib into the discussion area below. That way, other people can play your MadLib!

6. To play someone else's MadLib, copy someone's code from the discussion area below, and paste it into the top-left corner of a new file in Wing IDE. Click the green "play" arrow and play the game in the lower-right corner. Let others know what you think of their MadLibs!

Task Discussion


  • Landon said:

    # Author: Landon Mayo
    # Title: Madlib Project
    # Date: Jan 12, 2012
    # Program: This will give produce a modifed Doc Ock quote from Spider-Man 2.
    '''
    "We can rebuild. Enlarge the containment field. 
    Make it bigger and stronger than ever! But we need money."
    (Alfred Molina as Doc Ock in Spider-Man 2, 2004)
    '''
    '''
    "We can [verb]. [verb] the [noun]. 
    Make it [comparitive] and [comparitive] than [preposition]! 
    But we need [count noun]."
    (Alfred Molina as Doc Ock in Spider-Man 2, 2004)
    '''
    def intro():
        print ""
        print "This will give produce a modifed Doc Ock quote from Spider-Man 2."
        print ""
    
    def original():
        print " The Original:\n"
        print "We can rebuild.\nEnlarge the containment field.\nMake it bigger and stronger than ever!\nBut we need money.\n\n(Alfred Molina as Doc Ock in Spider-Man 2, 2004)"
        print ""
    
        
    #Get the words
    def modified():
        verb0=raw_input("Please enter a verb: ")
        verb1=raw_input("Please enter another verb: ")
        noun0=raw_input("Please enter a noun: ")
        countNoun0=raw_input("Please enter a count noun: ")
        comparitive0=raw_input("Please enter a comparitive: ")
        comparitive1=raw_input("Please enter another comparitive : ")
        preposition=raw_input("Please enter an adverb: ")
        print ""
        print "We can", verb0 + ".\n", verb1, "the", noun0 + "."
        print "Make it", comparitive0, "and", comparitive1, "than", preposition + "!"
        print "But we need", countNoun0 + "."
        print ""
    intro()
    modified()
    original()
    
    print "Thanks for playing!"
    

    on Jan. 12, 2012, 1:23 a.m.
  • Sparker said:

     

    adjective1 = raw_input('Enter an adjective and press enter. ')
    adjective2 = raw_input('Enter another adjective and press enter. ')
    noun1 = raw_input('Enter a noun (singular) and press enter. ')
    adjective3 = raw_input('Enter an adjective and press enter. ')
    noun2 = raw_input('Enter a noun (singular) and press enter. ')
    verb1 = raw_input('Enter a past-tense verb and press enter. ')
    verb2 = raw_input('Enter another verb and press enter. ')
    noun3 = raw_input('Enter a noun (plural) and press enter. ')
    adjective4 = raw_input('Enter an adjective and press enter. ')
    adjective5 = raw_input('Enter an adjective and press enter. ')
     
    print ' '
    print 'The',adjective1,adjective2,noun1
    print ' '
    print 'The',adjective1,adjective2,noun1,'jumped over the',adjective3,'dog and into a',noun2 + '.'
    print 'He',verb1,'all around for something to',verb2 + ',' 
    print 'but only found a couple of lazy',noun3 + '.'
    print 'Evenutally, the',adjective1,adjective2,noun1,'got',adjective4,'and laid down for a nap.'
    print 'When he woke up, the',adjective3,'dog was',adjective5 + '!'
    on Jan. 8, 2012, 6:16 p.m.
  • Jim Roma said:

    name = raw_input("Tell me your name and, click enter. ")
    COLOR1 = raw_input(name + " tell me a color, and click enter. ")
    SUPERLATIVE = raw_input(name + " tell me a superlative (ending in est), and click enter. ")
    ADJECTIVE1 = raw_input(name + " tell me an adjective, and click enter. ")
    BODY_PART_P = raw_input(name + " tell me an a plural body part, and click enter. ")
    BODY_PART = raw_input(name + " tell me an a body part, and click enter. ")
    NOUN = raw_input(name + " tell me an a noun, and click enter. ")
    ANIMAL_P = raw_input(name + " tell me an a plural animal, and click enter. ")
    ADJECTIVE2 = raw_input(name + " tell me another adjective, and click enter. ")
    ADJECTIVE3 = raw_input(name + " tell me another adjective, and click enter. ")
    ADJECTIVE4 = raw_input(name + " tell me yet another adjective (last one I promise), and click enter. ")

    print ""
    print "The " + COLOR1 + " Dragon is the " + SUPERLATIVE + " Dragon of all."
    print "It has " + ADJECTIVE1 + " " + BODY_PART_P + " , and a " + BODY_PART + " shaped like a " + NOUN + "."
    print "It loves to eat " + ANIMAL_P + ", although it will feast on nearly anything. It is " + ADJECTIVE2 + " and " + ADJECTIVE3 + "."
    print "You must be " + ADJECTIVE4 + " around it, or you may end up as it's meal!"

    on Dec. 28, 2011, 12:02 p.m.
  • Brylie Oxley said:

     

    import random
    
    # Get three nouns
    nouns = []
    for i in range(3):
        nouns.append(raw_input("Please tell me a noun: "))
    
    # Shuffle the nouns
    random.shuffle(nouns)
    
    # Get more words
    adjective = raw_input("Please tell me an adjective: ")
    adverb = raw_input("Please tell me an adverb: ")
    superlative = raw_input("Please tell me a superlative: ")
    verb = raw_input("Please tell me a verb: ")
    
    # Create a word tuple
    words = (adjective,adverb,nouns[0],superlative,nouns[1],verb,nouns[2])
    
    # Put all of the words in to the poem
    print """
    The %s sun loomed %s over the %s.
    In moments like this we remember our %s %s.
    How often is it that we %s the %s?
    """ % words

    on Dec. 24, 2011, 6:36 p.m.

    Nathan Day said:


     

    The cute sun loomed smarly over the whale.
    In moments like this we remember our most likely to be on America's Most Wanted cat.
    How often is it that we flew the fish?
     
    As of right now I don't undestand the %s character reference. I can see what it does but I am going to look up a novice definition and post it up with my Mad Lib original tomorrow. Python definitions can be confusing. Cool tutorial.
    on Dec. 26, 2011, 10:04 p.m. in reply to Brylie Oxley

    Landon said:

    Nice!

    The high sun loomed yesterday over the airplane.
    In moments like this we remember our highest boat.
    How often is it that we jump the car?

    on Jan. 11, 2012, 10:56 p.m. in reply to Brylie Oxley

    Landon said:

    I tried to give you a badge but none seemed to be defined. Did you already get one for the Madlib?

    on Jan. 11, 2012, 10:57 p.m. in reply to Brylie Oxley

    Landon said:

    on Jan. 11, 2012, 11:19 p.m. in reply to Nathan Day