{"size": 2943, "ext": "js", "max_stars_repo_path": "section2/exercises/decision-making.js", "max_stars_repo_name": "davidhdaw/mod-0-project-fe", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "section2/exercises/decision-making.js", "max_issues_repo_name": "davidhdaw/mod-0-project-fe", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "section2/exercises/decision-making.js", "max_forks_repo_name": "davidhdaw/mod-0-project-fe", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 46.7142857143, "max_line_length": 128, "alphanum_fraction": 0.7315664288}
/*
This exercise file is a little different from the others you have seen so far. Read carefully!

Below is a dynamic story that is created based on the value of three variables: doorChoice, bearClothing, bearChoice.
Spend some time changing the variables and running the file to see how the story changes.
*/

var doorChoice = 1;
var bearClothing = "";
var bearChoice = 1;

console.log("You enter a dark room with two doors. Do you go through #1 or #2?");

if (doorChoice === 1) {
  bearClothing = "hat";
} else {
  bearClothing = "scarf";
}

console.log("You see a bear putting on a " + bearClothing);
console.log("It looks like that " + bearClothing + " is too small for the bear, do you...");

console.log("1. Offer your own to the bear?");
console.log("2. Point it out to the bear?");
console.log("3. Make a dash for the next room?");

if (bearChoice === 1) {
  console.log("You offer the bear your " + bearClothing + " and the bear shows you a secret passage out!");
} else if (bearChoice === 2) {
  console.log("You tell the bear the " + bearClothing + " is too small and it starts to cry!");
} else if (bearChoice === 3) {
  console.log("You run as fast as you can into the next room. It's full of snakes!");
} else {
  console.log("You stay with the bear and become it's best friend!");
}

/*
Questions

1. In English, using technical vocabulary, describe what is happening between lines 14 and 18.
It's evaluating if the variable door choice is equal to one. If so it's assigning the variable bearClothing the string "hat"
otherwise it's assigning it the string "scarf"
2. What variable has a new value assigned to it after the first if statement executes?
bearClothing
3. If you changed the variable doorChoice to equal 3, what would the bearClothing value be?
scarf
4. In English, using technical vocabulary, describe what is happening between lines lines 27 and 35.
It's evaluating if the variable bearChoice is equal to 1. If it is it logs the concatenated string
"You offer the bear your " + bearClothing + " and the bear shows you a secret passage out!"
if it is not equal to 1 it evaluates if it's equal to 2. If that's true it logs the string
"You tell the bear the " + bearClothing + " is too small and it starts to cry!"
if that is also not true it evaluates if the variable is equal to 3. If that's true it logs
"You run as fast as you can into the next room. It's full of snakes!"
and if it is not true it logs
"You stay with the bear and become it's best friend!"
5. If you changed the variable bearChoice to equal 3, what will be the final outcome be?
"You run as fast as you can into the next room. It's full of snakes!"
6. If you changed the variable doorChoice to equal 1, and the variable bearChoice to equal 2, what will be the final outcome be?
"You tell the bear the hat is too small and it starts to cry!"
7. What is your favorite ending?
Anyone who says anything but making friends with the bear is a narc.
*/
