joanajimfer / e-s2-evaluacion-intermedia-joanajimfer

e-s2-evaluacion-intermedia-joanajimfer created by GitHub Classroom
MIT License
0 stars 0 forks source link

Finish the game #1

Closed nasivuela closed 5 years ago

nasivuela commented 5 years ago

Good job @joanajimfer !!!

Here you have some tips to improve the exercise:

You are close to the exercise solution, but here you are 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

Let me know if you have any doubts ;)

Go for it!!

joanajimfer commented 5 years ago

Hello @nasivuela, I correct the issues and now the game works properly, please, check it to know if it is ok.

nasivuela commented 5 years ago

Awesome @joanajimfer !!

I'm closing this, but here you have more tips if you want to keep improving it: