crod2 / f-m2-evaluacion-intermedia-crod2

f-m2-evaluacion-intermedia-crod2 created by GitHub Classroom
http://beta.adalab.es/f-m2-evaluacion-intermedia-crod2/
0 stars 0 forks source link

Finish the exercise! #1

Closed oneeyedman closed 5 years ago

oneeyedman commented 5 years ago

Hi, @crod2 !!!

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!!

oneeyedman commented 5 years ago

Good job @crod2!!!

Here you have some tips to improve the exercise:

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

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

Let me know if you have any doubts ;)

Go for it!!