Untitled


SUBMITTED BY: Guest

DATE: Sept. 6, 2016, 12:55 a.m.

FORMAT: Text only

SIZE: 591 Bytes

HITS: 856

  1. window.onload = selectGuessField;
  2. function selectGuessField()
  3. {
  4. guessfield.select();
  5. guessfield.focus()
  6. }
  7. // the game "loop" -------------------------------------------------------------
  8. function checkGuess()
  9. {
  10. // *** get inputs ***
  11. guess = parseFloat(guessField.value);
  12. // *** calculate the new state ***
  13. if (Number.isInteger(guess)) // an integer was entered
  14. {
  15. if (guess == theNumber) // the guess was correct (collision detection)
  16. {
  17. comment = REPSUCCESS;
  18. gameIsOver = true;
  19. }
  20. // ******UP TO HERE**********************************
  21. }

comments powered by Disqus