Hot and cold guessing game in JavaScript