Code Monkey home page Code Monkey logo

rock-paper-scissors's Introduction

Rock Paper Scissors

The point of this project was to practice the fundamentals of javascript.

Functionality

  • Use Query Selectors for buttons
  • Use logic to determine who wins a round and who wins the game
  • Player plays against computer
  • First to five points wins
  • Replay game with the push of a button!

Screenshots

Start page

start page

Draw result

Draw result

Replay option

replay option

Key Takeaways

  1. Unless it's being declared for the first time, functions will always be called when using parenthesis, even when they are being stored in a variable.

  2. If you declare a variable, it must be used in the scope or else it will say it's been declared, but is never read.

  3. A function MUST return something in most situations. Don't forget to add a return value!

  4. If you pass a function as an argument to another function. You must execute that function inside of the new function, and you probably want to then store that returned value inside of a new variable so that it can be used throughout the new function.

  5. Make sure you understand what logical operators are really doing.

  6. Use a whiteboard to track flow of program.

rock-paper-scissors's People

Contributors

brentbarnes 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.