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
scissors
beatspaper
paper
beatsrock
rock
beatslizard
lizard
beatsspock
spock
beatsscissors
scissors
beatslizard
lizard
beatspaper
paper
beatsspock
spock
beatsrock
rock
beatsscissors
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
.
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.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!