Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

The Variable Challenge - Here is my story :)) what do you think ?

alert("Hello my friend ");
alert("Today you have the chance to help me with my JavaScript task");
alert("We can create a beautiful and funny story together");
alert("Please follow the instructions and complete the empty spaces as i ask ");


var noun = prompt ("Please type the funniest noun you can think about right now :D ");

var adj = prompt ("Thanks! Can you type an adjective that can be related with your noun ? ");

var name = prompt (" Please name your hero , should be  the funniest name you can think about. " );

var describe = prompt ("Please type a feature that can best describe your hero. ");

var city = prompt ( " Please write the city that your hero will adore " );

var time = prompt ( " Now , Please write a time phrase , example : /' 1 year ' / ");


alert( " Thank you ! Now be ready ! Here comes the action :)) ");


document.write ( " Once opon a time , there was this little and scared " + noun + ". He / she  was living in a countryside city named " + city + ". He / she  loved the pubs and the nights out but his / her friends saw him / her  a little bit too " + adj +" and " + describe + "  so they named him / her  " + name + " . After  " + time + " our friend decided to make a change to his/her life , so he/she decided to cut his/her hair . " + " Now , He/she  is an " + describe +" ," + adj + " and bald-headed "+ noun + " who lives in "+ city +  " :))) ." );

1 Answer

Nice! maybe what you could do next is ask what gender the hero is and using a conditional statement have the story fit to that, instead of having him/her/them he/she/they his/her/their, it would make it more personal to the character and the story :)