window.onload = selectGuessField; function selectGuessField() { guessfield.select(); guessfield.focus() } // the game "loop" ------------------------------------------------------------- function checkGuess() { // *** get inputs *** guess = parseFloat(guessField.value); // *** calculate the new state *** if (Number.isInteger(guess)) // an integer was entered { if (guess == theNumber) // the guess was correct (collision detection) { comment = REPSUCCESS; gameIsOver = true; } // ******UP TO HERE********************************** }