Giter VIP home page Giter VIP logo

los-anillos-del-poder's People

Contributors

lrpoblet avatar

Stargazers

Roman avatar

Watchers

 avatar

los-anillos-del-poder's Issues

Some improvements

Some improvements

Really cool job @Lrpoblet !!!

Here you have some tips to improve the exercise:

JavaScript: basic

  • Fix the if's structure: check for one option, then the other and then for the rest is enough with an else statement.
  • Remove debugger and other unnecessary code

Bonus

  • Define the logic to count the points of each player
  • The counter must be an integer.
  • Don't use an element to resolve the counter, a good old constant will suffice ;)
  • Use three counter variables: one for user wins, other for computer wins and another for total rounds played.
  • Increment the counter for user wins when the user wins a round (find the correct conditions).
  • Increment the counter for computer wins when the computer wins a round (find the correct conditions).
  • Increment the round counter always the user clicks on "Batalla" button.
  • Show the counters in the proper elements of the page.
  • Check if the round counter has reached the limit of rounds.
  • Move you counter logic into a function and execute it on each click.

JavaScript: advanced

  • Check if the <select> has the default option .

Good practices

  • Indent and avoid extra white spaces to improve readability and prevent bugs. Configurate code formatter in VS Code!!!
  • Remove unnecessary commented code.

HTML

  • Add form

Steps to bonus the game

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. Use three counter variables: one for user wins, other for computer wins and another for total rounds played.
  3. Increment the counter for computer wins when the computer wins a round (find the correct conditions).
  4. Increment the round counter always the user clicks on "Batalla" button.
  5. Show the counters in the proper elements of the page.
  6. Create other function to check if the players have reached the maximum limit of rounds and call it from the listener function.
  7. Add a reset button that cleans the select, the counter and writes the initial feedback

Further challenges

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

  • Show an image with the user and computer selection
  • Make the input work when selecting the option.
  • Whatever you want!

Call to action

Let me know if you have any doubts ;)

Go for it!!

Do not close this issue until your teacher asks you to

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.