← Back
Code Challenge 2 - Mad Lib
Introduction
A mad lib is a simple word game where the player is asked to provide a number of words such as a noun, food, place, verb, adjective, etc. The player is then provided a silly story that has their words inserted into specific places. Try a mad lib here if you’ve never played one before.
Skills to Practice
- Prompting a user for input
- Saving user input to variables
- Formatting custom output using variables
Challenge Tasks
- Create a console project named CodeChallenge2MadLib.
- Complete the folowing tasks:
- Output a story title at the beginning of your program.
- Prompt the user to input two nouns and save them each to a variable.
- Prompt the user to input two numbers and save it to a variable.
- Output a story that is four lines long. Your story should use the variables throughout and resemble a mad lib game.
In short, when the user plays the game, they should be able to enter some values, and read their custom story.
Sample Output