Skip to content

AI‐14

Saúl Castillo edited this page Sep 20, 2024 · 1 revision

There are at least 8 bugs in this assignment students need to find and correct. The submitted assignment's program is expected to:

  1. Have no errors in the browser console.
  2. At the start, the reset button and all of the messages should be hidden.
  3. An user should be able to type a number into the input field and click Submit Guess to submit the form.
  4. When the form is submitted, an user should see the following:
    • A message displaying the number that was entered.
    • A message displaying how many tries you have left (starts at 5 and decrements by 1).
    • A message describing the guess (too low, too high, etc.).
    • A "reset" button that restarts the game.
  5. If the guessed number is BELOW the target, the message should say too low.
  6. If the guessed number is ABOVE the target, the message should say too high.
  7. If the guessed number is the SAME as the target, then:
    • The input field and "Submit Guess" button should be disabled.
    • The message should say guessed correctly.
  8. If the guessed number is not the same AND all 5 tries have been used, then:
    • The input field and Submit Guess button should be disabled.
    • The message should say 0 guesses remaining.
  9. When you click the reset button, the form should return to its initial state (not disabled).

As stretch goals (optional):

  1. You should not be able to submit a guessed number lower than 1.
  2. You should not be able to submit a guessed number higher than 99.
  3. If there is only one guess left, it should say "guess" (singular) instead of "guesses" (plural)
Clone this wiki locally