Treehouse is Some Kind of Special

I am building all kinds of things! Learning Loops, Arrays, and Objects now that I finished the JavaScript Basics course in 5 days. I have 6 badges and looking to get more and more, as quickly as possible.

Look out for a podcast soon on Treehouse, tomorrow or later today.

Check out this Pen I made from a Treehouse challenge. Did it for my writer friends. In order not to annoy you with alerts, I chose JavaScript to be the default tab in the Pen. Click the result tab to play:

 

[codepen_embed height="268" theme_id="0" slug_hash="oXadEd" default_tab="js" user="twhite96"] // quiz begins, no answers correct var correct = 0;

// ask questions

var answer1 = prompt("This character wound up in 12 of Ernest Hemingway's short stories."); if (answer1.toUpperCase() === 'NICK ADAMS') { correct += 1; } var answer2 = prompt("Who wrote Uylsses?"); if (answer2.toUpperCase() === 'JAMES JOYCE') { correct += 1; } var answer3 = prompt("This author wrote their best work in a collection of stories called Cathedral."); if (answer3.toUpperCase() === 'RAY CARVER' || answer3.toUpperCase === 'RAYMOND CARVER') { correct += 1; } var answer4 = prompt("She wrote In the Cemetery Where Al Jolson is Buried."); if (answer4.toUpperCase() === 'AMY HEMPEL') { correct += 1; } var answer5 = prompt("This writer drowned themselves in the river after filling her pockets with rocks in 1941"); if (answer5.toUpperCase() === 'VIRGINIA WOOLF') { correct += 1; }

// outputs results alert("You got " + correct + " out of 5 questions correct.");

// outputs rank if (correct === 5) { alert("You won a gold Pulitzer wrapped in diamonds!"); } else if (correct >= 3) { alert("You won the MacArthur Fellowship. Not bad."); } else if (correct >= 1) { alert("You made the Amazon Best Seller list for some niche genre. Not bad. Not good either.") } else { alert("You are a flash fiction writer with no credits. Sucks to be you!"); }

See the Pen <a href='http://codepen.io/twhite96/pen/oXadEd/'&gt;Literary (opens in a new tab) Quiz for Writers (WIP)</a> by Tiffany White (<a href='http://codepen.io/twhite96'&gt;@twhite96&lt;/a (opens in a new tab)>) on <a href='http://codepen.io'&gt;CodePen&lt;/a (opens in a new tab)>.

I am building all kinds of things! Learning Loops, Arrays, and Objects now that I finished the JavaScript Basics course in 5 days. I have 6 badges and looking to get more and more, as quickly as possible.

Look out for a podcast soon on Treehouse, tomorrow or later today.

Check out this Pen I made from a Treehouse challenge. Did it for my writer friends. In order not to annoy you with alerts, I chose JavaScript to be the default tab in the Pen. Click the result tab to play:

 

[codepen_embed height="268" theme_id="0" slug_hash="oXadEd" default_tab="js" user="twhite96"] // quiz begins, no answers correct var correct = 0;

// ask questions

var answer1 = prompt(&quot;This character wound up in 12 of Ernest Hemingway's short stories.&quot;); if (answer1.toUpperCase() === 'NICK ADAMS') { correct += 1; } var answer2 = prompt(&quot;Who wrote Uylsses?&quot;); if (answer2.toUpperCase() === 'JAMES JOYCE') { correct += 1; } var answer3 = prompt(&quot;This author wrote their best work in a collection of stories called Cathedral.&quot;); if (answer3.toUpperCase() === 'RAY CARVER' || answer3.toUpperCase === 'RAYMOND CARVER') { correct += 1; } var answer4 = prompt(&quot;She wrote In the Cemetery Where Al Jolson is Buried.&quot;); if (answer4.toUpperCase() === 'AMY HEMPEL') { correct += 1; } var answer5 = prompt(&quot;This writer drowned themselves in the river after filling her pockets with rocks in 1941&quot;); if (answer5.toUpperCase() === 'VIRGINIA WOOLF') { correct += 1; }

// outputs results alert(&quot;You got &quot; + correct + &quot; out of 5 questions correct.&quot;);

// outputs rank if (correct === 5) { alert(&quot;You won a gold Pulitzer wrapped in diamonds!&quot;); } else if (correct &gt;= 3) { alert(&quot;You won the MacArthur Fellowship. Not bad.&quot;); } else if (correct &gt;= 1) { alert(&quot;You made the Amazon Best Seller list for some niche genre. Not bad. Not good either.&quot;) } else { alert(&quot;You are a flash fiction writer with no credits. Sucks to be you!&quot;); }

See the Pen <a href='http://codepen.io/twhite96/pen/oXadEd/'&gt;Literary (opens in a new tab) Quiz for Writers (WIP)</a> by Tiffany White (<a href='http://codepen.io/twhite96'&gt;@twhite96&lt;/a (opens in a new tab)>) on <a href='http://codepen.io'&gt;CodePen&lt;/a (opens in a new tab)>.

[/codepen_embed]

© tiff.RSS