Module 4
Almost Done with JavaScript!

WNM 601-OL2 : MS Inside Programming

  • Assignment 4.1: Guess the Number (Easy)

    Using HTML and JavaScript examples from this module create a simple "guess the number" game in which the computer picks a number from 1-100. The user then enters guesses with the computer answering "higher" or "lower" until the user has picked the number.

  • Assignment 4.2: Guess the Number (Medium)

    This assignment is OPTIONAL (ungraded) but if you get Assignment 4.1 to work, try changing the logic around so that you, the user, are picking the number that the computer has to guess. You’ll need to add two buttons to let the number know if its guess is "higher" or "lower" than the number you’ve picked. You should also add a field showing how many guesses the computer has taken before finding the right number. Consider working with a partner if you find this assignment challenging.n

    • assignment link
  • Assignment 4.3: Guess the Number (Hard)

    Again, this is an OPTIONAL assignment. If you get 4.1 and 4.2 to work, create an application where the computer guesses against itself. You’ll have to come up with a way to keep the functions separate so the computer doesn’t just look up the answer. Once you’ve got it working, run the game 10,000 times. How many times does it take more than seven guesses to execute? Don’t worry if you don’t get this far with this exercise. It’s not expected most students will. Do your best!

    • assignment link