Code Monkey home page Code Monkey logo

rpsls's Introduction

BOXT

Rock, Paper, Scissors, Lizard, Spock

This is a simple Next.js project that allows a user to play rock paper scissors against a computer that selects its own gesture at random. Right now it does not work as intended, as the computer always wins!

It's currently not working, a few bugs were added by the last person who touched this code.. We'd like you to get this project up and running and complete the game logic by extending the rules to include the lizard and spock gestures

โ›ฐ๏ธ ๐Ÿงป โœ‚๏ธ ๐ŸฆŽ ๐Ÿ––

Game logic

  • scissors beats paper
  • paper beats rock
  • rock beats lizard
  • lizard beats spock
  • spock beats scissors
  • scissors beats lizard
  • lizard beats paper
  • paper beats spock
  • spock beats rock
  • rock beats scissors

BDD Acceptance Criteria

AS A Player
WHEN I click a gesture from tthe game logic
THEN a round is played against the computer
AND the gesture the computer picks is not the same as mine
AND I see a message telling me who won (the player or the computer)
AS A Player
WHEN I click a gesture from the game logic
THEN a round is played against the computer
AND the gesture the computer picks is the same as mine
AND I see a message telling me that the game was a draw
AS A Player
HAVING played a game
WHEN I refesh the page
THEN the game is reset and can see the gesture buttons
AND I can play another game

๐Ÿ’…

Give the UI a lick of styles, be as basic or as fancy as you like!

๐Ÿ”

Ensure at least the core game logic is tested and feel free refactor / restructure the code / bring in new npm packages however you see fit to ensure the resulting code is high quality, extendable and maintainable.


This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying pages/index.js. The page auto-updates as you edit the file.

API routes can be accessed on http://localhost:3000/api/rounds. This endpoint can be edited in pages/api/rounds/index.js.

The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

rpsls's People

Watchers

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