function favShow(){
  alert("Last game: See if you can try and guess one of my favorite TV shows \nMake sure to capitalize the first letter.");
  let shows = ['Avatar', 'The Office', 'Silicon Valley', 'Lucifer', 'New Girl', 'Community', 'Psych', 'Parks and Rec', 'IT Crowd', 'Brooklyn Nine-Nine', 'B99'];

  let numGuess = 6;
  let correctAnswer = false;


  while (!correctAnswer && numGuess > 0){
    let guess2 = prompt("Can you guess what my favorite TV show is?");
    for (let index = 0; index < shows.length; index++){
      if (guess2 === shows[index]){
        alert("That's right! " + guess2 + " is one of my favorite shows!");
        correctAnswer = true;
        FINALCOUNT++;
        break;
      }
      console.log("current show: " + guess2 + " vs show options: " + shows[index]);
    }
    if (correctAnswer === true) {
      break;
    }
    alert("No, that's not it. Try again.")
    numGuess--;
  
  }
}
//TV Show guessing game: guess my favorite TV show from an array of choices
TV Show guessing game: guess my favorite TV show from an array of choices
TV Show guessing game : guess my favorite TV show from an array of choices
function favShow(){
  alert("Last game: See if you can try and guess one of my favorite TV shows \nMake sure to capitalize the first letter.");
  let shows = ['Avatar', 'The Office', 'Silicon Valley', 'Lucifer', 'New Girl', 'Community', 'Psych', 'Parks and Rec', 'IT Crowd', 'Brooklyn Nine-Nine', 'B99'];
  let numGuess = 6;
  let correctAnswer = false;
  while (!correctAnswer && numGuess > 0){
    let guess2 = prompt("Can you guess what my favorite TV show is?");
    for (let index = 0; index < shows.length; index++){
      if (guess2 === shows[index]){
        alert("That's right! " + guess2 + " is one of my favorite shows!");
        correctAnswer = true;
        FINALCOUNT++;
        break;
      }
      console.log("current show: " + guess2 + " vs show options: " + shows[index]);
    }
    if (correctAnswer === true) {
      break;
    }
    alert("No, that's not it. Try again.")
    numGuess--;
  }
}
function favShow ( ) { alert ( "Last game: See if you can try and guess one of my favorite TV shows \nMake sure to capitalize the first letter." ) ; let shows = [ 'Avatar' , 'The Office' , 'Silicon Valley' , 'Lucifer' , 'New Girl' , 'Community' , 'Psych' , 'Parks and Rec' , 'IT Crowd' , 'Brooklyn Nine-Nine' , 'B99' ] ; let numGuess = 6 ; let correctAnswer = false ; while ( ! correctAnswer && numGuess > 0 ) { let guess2 = prompt ( "Can you guess what my favorite TV show is?" ) ; for ( let index = 0 ; index < shows . length ; index ++ ) { if ( guess2 === shows [ index ] ) { alert ( "That's right! " + guess2 + " is one of my favorite shows!" ) ; correctAnswer = true ; FINALCOUNT ++ ; break ; } console . log ( "current show: " + guess2 + " vs show options: " + shows [ index ] ) ; } if ( correctAnswer === true ) { break ; } alert ( "No, that's not it. Try again." ) numGuess -- ; } }
TV Show guessing game: guess my favorite TV show from an array of choices
TV Show guessing game : guess my favorite TV show from an array of choices