let adjective = "small";
let noun = "baby";
let verb = "tormented";
let place = "mansion";
let adjective2 = "big";
let noun2 = "chicken";
let firstStory = "Once upon a time, there was a(n) " + adjective + " " + noun + " who loved to eat " + noun2 + "." + "The " + noun + " lived in a " + place + " and had "+ adjective2 +" nostrils that blew fire when it was " + verb + ".";
console.log("First story: " + firstStory);
adjective = "big";
noun = "toddler";
verb = "upset";
place = "little house";
adjective2 = "tiny";
noun2 = "cats";
let secondStory = "Once upon a time, there was a(n) " + adjective + " " + noun + " who loved to eat " + noun2 + "." + "The " + noun + " lived in a " + place + " and had " + adjective2 + " nostrils that blew fire when it was "+ verb +".";
console.log("Second story: " + secondStory);
Hi there. Welcome to the forum.
Can you provide a link to the lab you are working on? It was not included with your question.
I’ve edited your post to improve the readability of the code. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>
) to add backticks around text.
See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').
your output right now
First story: Once upon a time, there was a(n) small baby who loved to eat chicken.The baby lived in a mansion and had big nostrils that blew fire when it was tormented.
Second story: Once upon a time, there was a(n) big toddler who loved to eat cats.The toddler lived in a little house and had tiny nostrils that blew fire when it was upset.
and the tests want this:
// running tests
14. You should use the correct story format for the first story: "Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb].". Pay attention to spaces.
23. You should use the correct story format for the second story: "Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb].". Pay attention to spaces.
So to compare them, lets take the first story from your output and put it next to the first story from the test output.
Yours: Once upon a time, there was a(n) small baby who loved to eat chicken.The baby lived in a mansion and had big nostrils that blew fire when it was tormented.`
Theirs: Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb].
Looking at this, do you see any differences?
Look at the spacing especially. Does yours have all the same spaces as the theirs?
(do the same thing for the 2nd text also and see if you can find anything to fix)