Coder Social home page Coder Social logo

rock-paper-scissors's Introduction

Rock, Paper, Scissors

Project Description

This is a simple implementation of the classic game "Rock, Paper, Scissors" as part of The Odin Project's Foundations course. The project helps to practice and reinforce basic JavaScript skills, including working with functions, loops, conditionals, and user inputs.

Features

Playable game between a human player and the computer. Best-of-five rounds format to determine the winner. Simple and intuitive command-line interface. How to Play

The player selects one of the three options: Rock, Paper, or Scissors. The computer randomly selects one of the three options. The winner of the round is determined by the following rules: Rock beats Scissors. Scissors beats Paper. Paper beats Rock. The first to win three out of five rounds wins the game. Getting Started

Prerequisites To run this project, you need to have a web browser with JavaScript enabled.

Installation Clone the repository or download the project files to your local machine. Open the index.html file in your preferred web browser. Usage Open your browser's console (usually by pressing F12 or right-clicking on the page and selecting "Inspect" or "Inspect Element" and then navigating to the "Console" tab). Follow the prompts to input your choice of Rock, Paper, or Scissors. Project Structure

index.html - The main HTML file that loads the JavaScript. style.css - (Optional) CSS file for any styling, if you choose to add a user interface. script.js - The JavaScript file containing the game logic. Code Overview

script.js getComputerChoice - Function that randomly returns 'Rock', 'Paper', or 'Scissors'. playRound - Function that plays a single round of Rock, Paper, Scissors. It takes the player's choice and the computer's choice as arguments and returns the result of the round. game - Function that manages the best-of-five rounds and keeps track of the score. Acknowledgements

The Odin Project - This project is part of The Odin Project's curriculum.

rock-paper-scissors's People

Contributors

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