Created
February 12, 2013 23:06
-
-
Save saterus/4774334 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For my ((a family member))'s ((an event)) present about ((a number)) years ago, | |
I got him a ((gift:a noun)). Not a ((an adjective)) ((gift)) or a loud one or | |
even a ((an adjective)) ((gift)) that runs around chasing its ((a body part)) | |
and drooling on the ((a noun)). I got them a ((a proper noun)), bred in China | |
thousands of years ago to be the ((a plural noun)) of the royal family. We | |
named it ((a proper name)). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This week's exercise is to write a program that presents the user with Madlibs. The script should ask the user for a series of words, then fill in the proper places in the story using the user's answers.
We'll keep our story format very simple, using a
((...))
notation for placeholders. Here's an example:If your program is fed that template, it should ask you to enter "a gemstone" and then display your version of the story:
That covers the simple cases, but in some instances we may want to reuse an answer. For that, we'll introduce a way to name them:
With the above story, your program should ask for two gemstones, then substitute the one designated by
((gem:...)) at ((gem))
. That would give results like:You can choose any interface you like, as long as person can interact with the end result.
Now pair up and try your best to model this with properly decoupled objects sending messages to each other.
TDD will be your friend here. Start with the simplest thing possible.