VictoriaDiro / f-m2-evaluacion-intermedia-VictoriaDiro

f-m2-evaluacion-intermedia-VictoriaDiro created by GitHub Classroom
0 stars 0 forks source link

Complete the exercise! #1

Closed oneeyedman closed 5 years ago

oneeyedman commented 5 years ago

Really cool job @VictoriaDiro !!!

Here you have some tips to improve the exercise:

You are close to the exercise solution, but here you have a steps guide to complete it anyway ;)

  1. Save a reference to DOM elements in variables
  2. Generate the random number and save it to a variable
  3. Init counter of trials to 0
  4. Define a function that executes when the user clicks on the button, that
    • increments the counter and paints its value in the HTML
    • collect the value of the HTML input and compare it with the random number
    • if they are equal, draw a 'You Win' message
    • if it's lower, draw a 'Too short' message
    • if it's higher, draw a 'Too long' message
  5. Assign a listener to the button click to execute the previous function

Then you can improve the game as you please, here you have some ideas:

Let me know if you have any doubts ;)

Go for it!!

VictoriaDiro commented 5 years ago

Hi Carlos, I fix the exercise. Thanks for all!

oneeyedman commented 5 years ago

Good job, @VictoriaDiro!

If you are up to a challenge check out these exercises from previous Adalabers:

;)