Untitled


SUBMITTED BY: Guest

DATE: Aug. 15, 2016, 3:15 a.m.

FORMAT: Text only

SIZE: 1.0 kB

HITS: 1149

  1. /*
  2. Description: "guessing.js" is a simple guess the number game made to illustrate the basics
  3. of game programming.
  4. Author: David Johnston
  5. Date: 2016
  6. Version: 1
  7. Usage: Invoked via guessing.html
  8. */
  9. // game constants -------------------------------------------------------------
  10. const TITLE = "Guessing Game";
  11. const MAXNUM = 20;
  12. const CLUELOWER = "It's lower than that.";
  13. const CLUEHIGHER = "It's higher than that.";
  14. const REPSUCCESS = "Yes! You got it!";
  15. const NAIREPLY = "That doesn't appear to be an integer. Try again.";
  16. const R00 = "Ha! Ha! You're wrong!";
  17. const R01 = "Nope! Try again.";
  18. const R02 = "Sigh. You're not very good at this.";
  19. const R03 = "You god-awful shovel-full of fermenting garbage.";
  20. const R04 = "You nauseating bunch of illiterate rat cysts.";
  21. const R05 = "You insolent lump of unimpressive hogwash.";
  22. const ENTERKEY = 13; // the keycode for the enter key
  23. var headingArea = document.getElementById("headingArea");
  24. headingArea.innerHTML = TITLE;

comments powered by Disqus