// Variables
var secretNumber;

// Functions
function newGame() {
  secretNumber = Math.floor(Math.random() * 100);
}

// function checkNumber( num ) {
//   if ( guessedNumber > 100) {
//     $(feedbackContainer).text('Pick a number less than 100');
//   } else if ( guessedNumber < 0 ) {
//     $(feedbackContainer).text('Pick a number less than 100');
//   }
// }

function userGuessFeedback( num ) {
  var feedbackContainer = $('#feedback');

  if ( num == secretNumber ) {
    $(feedbackContainer).text('Correct!');
  } else if ( num < secretNumber ) {
    $(feedbackContainer).text('You guess was too low');
  } else if ( num > secretNumber ) {
    $(feedbackContainer).text('You guess was too high');
  }
}

function guess() {
  // Value of guess from input
  var guessedNumber = $('#userGuess').val();

  // userGuessFeedback
  userGuessFeedback( guessedNumber );

  // Append guess to guesslist
  $('#guessList').append("<li>" + guessedNumber + "</li>");

  // Add 1 to guess count
  var quessCount = parseInt($('#count').text());
  quessCount++;
  $('#count').text(quessCount);

  // Empty guess input field
  $('#userGuess').val('');
}


$(document).ready(function(){

  newGame();
  console.log( secretNumber );


  /*--- Start New Game on click ---*/
  $(".new").click( function(e) {
    newGame();
    console.log( "New game started, the secret number is : " + secretNumber );
    e.preventDefault();
  });


	/*--- Display information modal box ---*/
	$(".what").click( function() {
  	$(".overlay").fadeIn(1000);
	});


	/*--- Hide information modal box ---*/
	$("a.close").click( function() {
		$(".overlay").fadeOut(1000);
	});


  /*--- Submit Guess ---*/
  $('form').submit( function() {
    guess();
    return false;
  });

});





// Initially, you shouldn’t worry about telling users if they’re getting “hotter” or “colder” relative to their previous guess. Instead, you can use absolute values. For instance, you might decide that if a user is 50 or further away from the secret number, they are told they are “Ice cold”, if they are between 30 and 50 they are “cold”, if they are between 20 and 30 they are warm, between 10 and 20 hot, and between 1 and 10 “very hot”. We’ll leave it up to you to choose what the ranges are and what feedback you provide.


// You’ll need to ensure that users provide valid inputs. Note that the guess text input field has the HTML 5 required flag set, so you won’t have to worry about blank guesses being submitted (if the user submits a blank guess, they'll be prompted to supply an input). However, you will need to write code that ensures that the user has supplied a numeric input between 1 and 100.
@@ -116,256 +116,8 @@
 %0A%7D%0A%0A
-// function checkNumber( num ) %7B%0A//   if ( guessedNumber %3E 100) %7B%0A//     $(feedbackContainer).text('Pick a number less than 100');%0A//   %7D else if ( guessedNumber %3C 0 ) %7B%0A//     $(feedbackContainer).text('Pick a number less than 100');%0A//   %7D%0A// %7D%0A%0A
 func
@@ -190,17 +190,16 @@
 back');%0A
-%0A
   if ( n
@@ -229,84 +229,476 @@
     
-$(feedbackContainer).text('Correct!');%0A  %7D else if ( num %3C secretNumber ) %7B%0A
+var endGame = confirm( %22You have won the game!%22 );%0A    if ( endGame == true ) %7B%0A      newGame();%0A      $(feedbackContainer).text('Make your Guess!');%0A    %7D%0A  %7D else if ( num %3C secretNumber && (secretNumber - num) %3C= 5 ) %7B%0A    $(feedbackContainer).text('You are hot!');%0A  %7D else if ( num %3C secretNumber && (secretNumber - num) %3C= 15 ) %7B%0A      $(feedbackContainer).text(%22You're low, but warming up!%22);%0A  %7D else if ( num %3C secretNumber && (secretNumber - num) %3E 15 ) %7B%0A  
     
@@ -778,28 +778,304 @@
 ecretNumber 
+&& (num - secretNumber) %3C= 5 
 ) %7B%0A
+    $(feedbackContainer).text('You are hot!');%0A  %7D else if ( num %3E secretNumber && (num - secretNumber) %3C= 15 ) %7B%0A      $(feedbackContainer).text(%22You're high, but warming up!%22);%0A  %7D else if ( num %3E secretNumber && (num - secretNumber) %3E 15 ) %7B%0A  
     $(feedba
@@ -1245,16 +1245,50 @@
 eedback%0A
+  if ( guessedNumber %3C= 100 ) %7B%0A  
   userGu
@@ -1316,16 +1316,74 @@
 umber );
+%0A  %7D else %7B%0A    alert(%22Enter a number less than 100%22);%0A  %7D
 %0A%0A  // A
@@ -1724,25 +1724,24 @@
 tNumber );%0A%0A
-%0A
   /*--- Star
@@ -1822,105 +1822,20 @@
     
-console.log( %22New game started, the secret number is : %22 + secretNumber );%0A    e.preventDefault()
+return false
 ;%0A  

Add validation & better commits for each quess