Coder Social home page Coder Social logo

amex-w02d04-minigame's Introduction

Rock-Paper-Scissors

Description

For Morning Exercise, we will build Rock-Paper-Scissors to practice using JavaScript and implementing more complex logic.

You will need to design logic for the game so that one person can play against the computer multiple times and update a scoreboard that will keep track of how many wins each "player" has.

Note: I did not design the HTML and CSS for this exercise.

Desired Functionality

The flow of this app should be:

  1. User selects Rock, Paper, or Scissors by clicking on a button.
  2. After clicking a button for either Rock, Paper, or Scissors several things need to happen in your JS file
    1. The user's selection must be stored so it can be compared later to the computer's selection
    2. The computer must make it's selection. To do this, generate a random number and use an if/else statement to "choose" either Rock, Paper, or Scissors
    3. Compare the two choices to determine a winner and then...
      1. Display the winner's "name" on the screen
      2. Display which "value" each side chose
    4. Update the scoreboard that shows how many times each player (human or computer) has won
  3. Now that the first game has been resolved, the user can make another selection that will clear out the winner text from Step 2.3 and start the process over again

bonus

generate a random img inside random-img class

amex-w02d04-minigame's People

Contributors

ghadeer-x avatar

Watchers

James Cloos avatar

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.