Skip to main content

A Rock Paper Scissors game

Project description

RPScissors

This module makes it easy to create a Rock Paper Scissors game in Python.

Basic example

import RPScissors

game = RPScissors.create_default_game()

user = input("Choose stone, paper or scissors: ")
computer, result = game.play_round(user)

print("Computer chose:", computer)
print("Result:", result)

Advanced example

import RPScissors

options = ["fire", "water", "plant"]
win_rules = {
    "fire": "plant",
    "plant": "water",
    "water": "fire",
}

game = RPScissors.systemRPS(options, win_rules)

user = input("Choose fire, water or plant: ")
computer, result = game.play_round(user)

print("Computer chose:", computer)
print("Result:", result)

You can now specify the names of the options yourself. And adjust the winning rules.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rpscissors-0.0.3.tar.gz (2.7 kB view details)

Uploaded Source

File details

Details for the file rpscissors-0.0.3.tar.gz.

File metadata

  • Download URL: rpscissors-0.0.3.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for rpscissors-0.0.3.tar.gz
Algorithm Hash digest
SHA256 f278dea9da4bc795b8b55dd30c73744251b5ce49a50e7cbc4d3fe26b20b0f88e
MD5 78140e2b12ec2fffe46959cec3a41518
BLAKE2b-256 2c073e5ff4eb60047b23262773e88b42e410cfd797c12daf2019608f527e80ec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page