Coder Social home page Coder Social logo

kofodym / rockpaperscissorsgame_ui Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 15 KB

A rock Paper Scissors Game played via a user interface displaying skills learnt in Javascript DOM manipulation

Home Page: https://kofodym.github.io/RockPaperScissorsGame_UI/

HTML 24.59% JavaScript 61.83% CSS 13.58%

rockpaperscissorsgame_ui's Introduction

RockPaperScissorsGame_UI

A Rock Paper Scissors Game played via a user interface displaying skills learned in Javascript DOM manipulation

Welcome to Rock Paper Scissors

You are presented with three game choices: ROCK, PAPER, AND SCISSORS.

The following instructions will guide you on how to play the game

  • If Rock beats Scissors
  • If Scissors beats Paper
  • If Paper beats Rock
  • If both players select the same option, then it is a tie, and the players replay the game again
  • After two rounds a winner is declared

Algorithm Used

1. Create your HTML structure 2. Add CSS to your HTML arranging how your game will look 3. Add a js file, and create a variable that will make a choice by selecting from a list of buttons(choices) 4. create variables that select ID and Classes from your HTML file 5. When the user clicks the button: Create an iteration through each of the buttons using foreach 6. Add an event listener to this button, that includes the click event handler and an arrow function. 7. Create the function that Randomly selects computer choice 8. Create the playGame function that Plays the game by comparing user_choice to computer_choice, and displays a message in the HTML field. 9. Initialize the round, countuser, and countComputer to 0 10. Add an increment in the playGame function for computer and user accordingly 11. Create a function called playRound to call the game and play a round 12. Enter arguments for the user and computer 13. Increment the round counter & Update the HTML elements with the round and scores 14. In the eventlistener, Call the playRound function and pass the clicked button 15. If it's the second round, declare the overall winner 16. Create an if statement to Reset values if the game has been played for two rounds 17. Update the HTML elements with the round, scores to 0 and text inputs to empty

rockpaperscissorsgame_ui's People

Contributors

kofodym avatar

Watchers

 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.