diff --git a/index.html b/index.html index da35074..9bc1ab2 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ - + diff --git a/practice/exercises/madlibs/README.md b/practice/exercises/madlibs/README.md new file mode 100644 index 0000000..68f5eca --- /dev/null +++ b/practice/exercises/madlibs/README.md @@ -0,0 +1,20 @@ +# Mad Libs + +Mad Libs is a "template" game where you ask the user for a list of words to substitute for blanks in a story or phrase. + +1. Choose your mad lib. You can search online or come up with your own story/phrase. +Examples: +- "What came first the chicken or the ______?" +- "Once upon a time, ______ went to the _______ to _________." + +2. Declare a new variable and ask the user for the value of each blank/missing part in your chosen madlib. + +3. Form a new string substituting the blanks with the values given by the user. (hint: use string concatenation) + +3. Display the result either through logging it to the console or using alert. + +To get a user's input, you may choose to use `prompt()` as shown below then save it to a variable. + +`let name = prompt("Enter a name.")` + +Bonus: If you're already familiar with JavaScript DOM manipulation, you can choose to display the text on the HTML page. diff --git a/practice/exercises/madlibs/index.html b/practice/exercises/madlibs/index.html new file mode 100644 index 0000000..b45e2f5 --- /dev/null +++ b/practice/exercises/madlibs/index.html @@ -0,0 +1,10 @@ + + +
+ +