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.4.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rpscissors-0.0.4-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rpscissors-0.0.4.tar.gz
  • Upload date:
  • Size: 6.0 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.4.tar.gz
Algorithm Hash digest
SHA256 67acbb8004d42fa80ad35f6891d29bbc6288ecfdf4d01d66892a2f74bc971c70
MD5 180c8e0ef0255c3b926c05311f3deda8
BLAKE2b-256 9036db542e5f4b21b9cdd4ba5d2e77d0920e9a829fda8e67e7269024b9a29da8

See more details on using hashes here.

File details

Details for the file rpscissors-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: rpscissors-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for rpscissors-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e740c828cdb976e452a3e2e9c4eece781eeb5b1552280053ae59d0def061fe95
MD5 eddffe3c74f388a032178e32c00e115d
BLAKE2b-256 018dab66fa94bfdf4c9053a46813371da06bb2a1674c76f4fd2eba2a723f5c57

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