Giter Club home page Giter Club logo

if-ands-or-buts's Introduction

If, Ands, or Buts

In this assignment, we'll be continuing to build programs with if statements. As usual, start off by forking then cloning this repository.

lock-box.js

You've been contracted to write the software for a lock box.

Write a program called lock-box.js that stores the pin code to the lock box in a variable at the top of your program (i.e.: let pinCode = '1234';).

After that, use prompt-sync to prompt the user for the passcode. If the user gets the passcode exactly correct, log a success message containing the word, "success". If not, log a failure message containing the word, "failure".

Note: In this assignment, the node_modules folder containing the prompt-sync dependency does not already exist. To add it to this project, navigate to this repository using the command line then install it using the Node Package Manager with npm install prompt-sync.

rock-paper-scissors.js

Let's play a classic game of rock, paper, scissors!

Write a program called 'rock-paper-scissors.js' that takes in two inputs in a row for Player 1 and Player 2.

The players can only input "rock", "paper", and "scissors". Anything else should result in a failure message getting logged to the screen. After both players input their options, use console.log() to print the player who emerged victorious.

For those who are unfamiliar, rock beats scissors, scissors beats paper, and paper beats rock. If both players input the same answer, it should result in a draw.

An example game

Player 1, enter "rock", "paper", or "scissors":
> rock
Player 2, enter "rock", "paper", or "scissors":
> paper
Player 2 wins!

if-ands-or-buts's People

Contributors

alexcrist avatar glf30 avatar aaronlacey 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.