PWP Final Project 2
PWP Final Project 2
1 3.Proposed Methodology 2
4. Action Plan 3
5. Resources Required 4
1.Rationale 5
8. Output 11-12
1
Annexure I
Micro Project Proposal
Mad lib python generator game
Mad libs generator is a fun game that is usually played by kids. In this python game user has
to enter substitutes for blanks in the story without knowing the story. It will be fun to read aloud
the stories after filling the blanks.
3. Proposed Methodology:
The objective of this project is to develop a Mad Libs Generator python project. In this project,
the user first has to pick a story by the title of the story. Then the user has to enter specific words
like a noun, adverb, verb, food, adjective, etc, according to the requirements. And then the story
will be generated.
This is a python project for absolute beginners and is developed using the basic concept of
python and tkinter.
Remember the days when multiple players were required to play the Mad Libs in the
parties/school. Well, that time is gone; because parties have become obsolete in this COVID-19
era, so we bring to you an easy-to-code, single-player, virtual mad libs generator gamethat you
can play alone. Get a list of words to substitute for blanks in a story before reading aloud, have
fun and learn about Tkinter library as well.
2
4. Action Plan:
20/01/2024 27/01/2024
2
Kalyani Sakshi
Shivanand
5. Resources Required:
3 Browser Chrome 1
3
6. Names of Team Member with Roll No.:
4
Annexure – II
Micro-Project Report
Mad lib python generator game
1. Rationale:
Python is a powerful programming language.It has efficient high-level data structure and a
simple but effective approach to object-oriented programming.Python code is
simple,short,readable,intiutive,and powerful,and thus is effective for introducing and computing
and problem solving to beginners.It‟s eligant syntax and dynamic typing together with it‟s
interpreted nature,make it an ideal language for scripting and rapid application development in
many areas on most platforms.
2. Aims/Benefits of the Micro-Project:
Mad libs generator is a fun game that is usually played by kids. In this python game user has
to enter substitutes for blanks in the story without knowing the story. It will be fun to read aloud
the stories after filling the blanks.
4. Literature Review:
Mad Libs was invented in 1953 by Leonard Stern and Roger Price. Stern and Price created the
game, but could not agree on a name for their invention. No name was chosen until five years
later (1958), when Stern and Price were eating Eggs Benedict at a restaurant in New York City.
While eating, the two overheard an argument at a neighboring table between a talent agent and
an actor. According to Price and Stern, during the overheard argument, the actor said that he
wanted to "ad-lib" an upcoming interview. The agent, who clearly disagreed with the actor's
suggestion, retorted that ad-libbing an interview would be "mad". Stern and Price used
that eavesdropped conversation to create, at length, the name "Mad Libs".In 1958, the duo
5
released the first book of Mad Libs, which resembled the earlier
games of consequences and exquisite corpse.
Stern was head writer and comedy director for The Steve Allen Show, and suggested to the
show's host that guests be introduced using Mad Libs completed by the audience. Four days after
an episode introduced "our guest NOUN, Bob Hope", bookstores sold out of Mad Libs books.
Stern and Price next partnered with Larry Sloan, a high school friend who was working as
a publicist at the time, to continue publishing Mad Libs. Together, the three founded the
publishing firm Price Stern Sloan in the early 1960s as a way to release Mad Libs. In addition to
releasing more than 70 editions of Mad Libs under Sloan, the company also published 150
softcover books, including such notable titles as How to Be a Jewish Mother, first released in
1964; Droodles, which was also created by Roger Price; The VIP Desk Diary; and the
series World's Worst Jokes.
Price died in 1990, and three years later, Sloan and Stern sold Price Stern Sloan, including Mad
Libs, to the former Putnam Berkley Group, which is now known as Penguin Random
House. Mad Libs books are still published by Penguin Random House; however, all references to
Price Stern Sloan have been removed from the company's official website. Stern died at age 88
on June 7, 2011, and Sloan on October 14, 2012.
More than 110 million copies of Mad Libs have been sold since the game series was first
published in 1958.
MAD LIBS is one of the world‟s fun word games. Some would even call it one of the
„GREATEST WORD GAME”. If you enjoy playing around with words, then you probably agree
MadLibs is a phrasal template word game where one player prompts others for a list of words to
substitute for blanks in a story/poem/rhyme before reading aloud. The game is frequently played
It is a game where there are neither losers or winners. A game that fills the room with laughter
and creates such a relaxing environment, something every one of us needs from time to time for a
healthy mental state.
6
In this article, I am going to share a simple way of creating this game in Python. As a beginner or
expert developer, we do need that little fun. Even if you have no coding experience at the moment
while reading this article, you will be able to grasp a few concepts and a basic understanding
of Python Programming.
HOW IT IS PLAYED
Most often, the game has a simple sequence around it, the aim might be to form a simple
poem/rhyme such as the one below, or a short story, just for fun.
“Roses are red, Violets are Blue, Sugar is sweet and So are you”.
3 Browser Chrome 1
7
DFD OF MAD LIB GENERATOR
7. Source Code:
#import module
from tkinter import *
8
# initialize window
root = Tk()
root.geometry('300x300')
root.title('DataFlair-Mad Libs Generator')
Label(root, text= 'Mad Libs Generator \n Have Fun!' , font = 'arial 20 bold').pack()
Label(root, text = 'Click Any One :', font = 'arial 15 bold').place(x=40, y=80)
################Stories##############
def madlib1():
def madlib2():
9
color = input('enter a color name : ')
thing = input('enter a thing name :')
place = input('enter a place name : ')
person= input('enter a person name : ')
adjactive1 = input('enter a adjactive : ')
insect= input('enter a insect name : ')
food = input('enter a food name : ')
verb = input('enter a verb name : ')
print('Last night I dreamed I was a ' +adjactive+ ' butterfly with ' + color+ ' splocthes that
looked like '+thing+ ' .I flew to ' + place+ ' with my bestfriend and '+person+ ' who was a
'+adjactive1+ ' ' +insect +' .We ate some ' +food+ ' when we got there and then decided to
'+verb+ ' and the dream ended when I said-- lets ' +verb+ '.')
def madlib3():
person = input('enter person name: ')
color = input('enter color : ')
foods = input('enter food name : ')
adjective = input('enter aa adjective name: ')
thing = input('enter a thing name : ')
place = input('enter place : ')
verb = input('enter verb : ')
adverb = input('enter adverb : ')
food = input('enter food name: ')
things = input('enter a thing name : ')
print('Today we picked apple from '+person+ "'s Orchard. I had no idea there were so many
different varieties of apples. I ate " +color+ ' apples straight off the tree that tested like '+foods+ '.
10
Then there was a '+adjective+ ' apple that looked like a ' + thing + '.When our bag were full, we
went on a free hay ride to '+place+ ' and back. It ended at a hay pile where we got to ' +verb+ ' '
+adverb+ '. I can hardly wait to get home and cook with the apples. We are going to make appple
'+food+ ' and '+things+' pies!.')
######buttons
Button(root, text= 'The Photographer', font ='arial 15', command= madlib1, bg ="ghost
white").place(x=60, y=120)
Button(root, text= 'apple and apple', font ='arial 15', command = madlib3, bg ="ghost
white").place(x=70, y=180)
Button(root, text= 'The Butterfly', font ='arial 15', command = madlib2, bg ="ghost
white").place(x=80, y=240)
root.mainloop()
8. Output:
11
12
9. Skill developed / Learning out of this Micro-Project:
From this project, we came to know about how a mad lib python game is built using PyCharm. In
the objective of doing so, you got to know the features of the mad lab as it is very intresting game,
its flow, and the requirements to build it. Further, we saw the things we need to know to get started
with the development of the mad lib game. Finally, we saw the actual implementation of the mad
lib python genenerator along with its source code.
*****
13