Skip to content

Instantly share code, notes, and snippets.

@desinas
Last active October 23, 2024 15:32
Show Gist options
  • Save desinas/711d73d1bb331652bc7e30bce35ebba1 to your computer and use it in GitHub Desktop.
Save desinas/711d73d1bb331652bc7e30bce35ebba1 to your computer and use it in GitHub Desktop.
Murder Mystery Quiz (3-4) Udacity Lesson 12
/*
* Programming Quiz: Murder Mystery (3-4)
*/
// change the value of `room` and `suspect` to test your code
var room = "dining room";
var suspect = "Mr. Parkes";
var weapon = "";
var solved = false;
if (room === "ballroom" && suspect === "Mr. Kalehoff") {
weapon = "poison"; solved = true;
} else if (room === "gallery" && suspect === "Ms. Van Cleve") {
weapon = "trophy"; solved = true;
} else if (room === "billiards room" && suspect === "Mrs. Sparr") {
weapon = "pool stick"; solved = true;
} else {
weapon = "knife"; solved = true;
}
if (solved) {
console.log(suspect + " did it in the " + room + " with the " + weapon + "!");
}
@mikiyas-l
Copy link

why is the initial value false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment