Git Product home page Git Product logo

rock-paper-scissor's Introduction

rock-paper-scissor

paper.svg rock.svg scissors.svg lizard.svg spock.svg

Description

This is a simple rock-paper-scissor game.

It has 2 different modes:

  • Classic mode: you play against the computer with the classic rules:

    • Rock crushes Scissors (✊ > ✌)
    • Scissors cuts Paper (✌ > ✋)
    • Paper covers Rock (✋ > ✊)
  • Extended mode: you play against the computer with the extended rules:

    • Scissors cuts Paper (✌ > ✋)
    • Paper covers Rock (✋ > ✊)
    • Rock crushes Lizard (✊ > 🦎)
    • Lizard poisons Spock (🦎 > 🖖)
    • Spock smashes Scissors (🖖 > ✌)
    • Scissors decapitates Lizard (✌ > 🦎)
    • Lizard eats Paper (🦎 > ✋)
    • Paper disproves Spock (✋ > 🖖)
    • Spock vaporizes Rock (🖖 > ✊)
    • Rock crushes Scissors (✊ > ✌)

Installation

Requirements

  • Python 3.10
  • Poetry
  • Docker & Docker Compose
  • Make

Setup - in local

To install the dependencies, run:

poetry install

To run the application, execute:

poetry run python app/manage.py runserver 8000

Setup - with Docker

To run the application, execute:

docker compose build
docker compose up -d --remove-orphans

To stop the application, execute:

docker compose down

Setup - with Makefile

To start the application, execute:

make start

To stop the application, execute:

make stop

Tests

Unit tests

To run the unit tests with coverage, execute:

poetry run coverage run -m pytest
poetry run coverage report

or

make coverage

For a more detailed report, run:

poetry run coverage html

and open the htmlcov/index.html file in your browser, or

make coverage

Pre Commit

Use pre-commit to run and validate your changes before a commit.

pre-commit is configured to run:

  • safety: dependencies security checks
  • black: check formatting

To install pre-commit use:

On macOS:

brew install pre-commit

On Linux:

pip install pre-commit

To install the pre-commit hooks, run:

pre-commit install

rock-paper-scissor's People

Contributors

aleorda avatar

Watchers

 avatar

rock-paper-scissor's Issues

Docker compose & build fail

Running docker compose build fails with the following error: services.rps.command.3 must be a string

Additionally, running docker build -t rps:latest . fails with the following error: /rock_paper_scissor does not contain any element

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.