Skip to main content

An example of a package developed with pipenv, built with build using setuptools, uploaded to PyPI using twine, and distributed via pip.

Project description

🎰 NimbusCasino

Python build & test

nimbuscasino is a lightweight and testable Python package with four classic chance-based mini-games:

  • Rock-Paper-Scissors
  • Coin Flip
  • Roulette (Red/Black)
  • Slots (3×3)

All game functions are pure (no input/print, no global state) and return structured results, so you can plug them into chatbots, simulations, or your own program.

⚠️ This package is for entertainment and educational use only — no real gambling or monetary transactions are involved.

Team Members

Name GitHub Profile
Asim @asimd0
Matt @m9membreno
Tup @treejitsu
Elia @YilinWu1028
Mojin @Mojin-Yuan

Installation

PyPi page

https://pypi.org/project/nimbuscasino/

1) Install pipenv (if needed)

pip install pipenv

2) Create/activate a virtual environment

pipenv shell

3) Install nimbuscasino from PyPi

pipenv install nimbuscasino

Verify your installation in python:

from nimbuscasino.rps import rps
print(rps("rock"))

Usage:

Each game function returns a dictionary containing details of the outcome.
You control any printing, UI, or balance-handling.
Note: Each function accepts an optional pseudo-random generator (rng) to support deterministic testing. You can ignore this in normal gameplay.


1) Rock-Paper-Scissors — rps(player, bet=1, rng=None)

Arguments

Name Type Description
player "rock", "paper", or "scissors" Your selection
bet number > 0 Wager amount
rng optional Must support .choice(seq) if provided

Return Example

{
  "game": "rps",
  "player": "rock",
  "computer": "scissors",
  "result": "win" | "lose" | "tie",
  "payout": 5
}

Example Usage

from nimbuscasino.rps import rps
res = rps("rock", bet=5)
print(res)

2) Coin Flip — coinflip(guess, bet=1, rng=None, bias=0.5)

Arguments

Name Type Description
guess "heads" or "tails" Your call
bet positive integer Wager
rng optional Must support .random() → float in [0,1)
bias float (0.0–1.0) Probability of heads

Return Example

{
  "game": "coinflip",
  "guess": "heads",
  "flip": "heads" | "tails",
  "win": True | False,
  "payout": 1 | -1 | ...,
  "prob_heads": 0.5
}

Example Usage

from nimbuscasino.coinflip import coinflip
res = coinflip("heads", bet=2)
print(res)

3) Roulette (Red/Black) — roulette_color(color, bet=1, rng=None)

Arguments

Name Type Description
color "red" or "black" Color to bet on
bet number > 0 Wager
rng optional Must support .choice(seq)

Return Example

{
  "result": True | False,
  "spin": "red" | "black" | "green",
  "payout": 10 | -10 | ...
}

Example Usage

from nimbuscasino.roulette import roulette_color
res = roulette_color("red", bet=10)
print(res)

4) Slots — spin_slots(bet=1, rng=None, symbols=None, weights=None, paytable=None, rows=3, cols=3)

Arguments

Name Description
bet Amount wagered per spin
rng Optional random source supporting .choices()
symbols, weights, paytable Optional custom reel configuration
rows, cols Dimensions of slot grid (Default: 3×3)

Return Example

{
  "game": "slots",
  "grid": [["🍋","🔔","🍋"], ["🍋","⭐","🍋"], ["🍒","🔔","🍋"]],
  "lines": { "middle": {"symbol":"🍋","count":3,"payout":6}, ... },
  "total_payout": 6
}

Example Usage

from nimbuscasino.slots import spin_slots
res = spin_slots(bet=3)
print(res)

Interactive Example Program

A demo is included for trying all four games:

File: example.py
https://github.com/swe-students-fall2025/3-python-package-team_nimbus/blob/main/example.py

Run it:

python example.py

Contributing (Local Development Setup)

# Clone repository
git clone https://github.com/swe-students-fall2025/3-python-package-team_nimbus.git
cd 3-python-package-team_nimbus

# Create / activate virtual environment
pipenv shell

# Install development dependencies
pipenv install --dev

# Install package in editable mode
pip install -e .

# Run test suite
pytest

# Build distributable packages
python -m build

(Optional) Upload Build to TestPyPI

twine upload --repository testpypi dist/*

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

nimbuscasino-0.1.0.tar.gz (47.6 kB view details)

Uploaded Source

Built Distribution

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

nimbuscasino-0.1.0-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

File details

Details for the file nimbuscasino-0.1.0.tar.gz.

File metadata

  • Download URL: nimbuscasino-0.1.0.tar.gz
  • Upload date:
  • Size: 47.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for nimbuscasino-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8f74d6b740fa19f2d7ea2edabc1266e51192542f9c19514b58c38acb865c1fd3
MD5 6988578ac7a3ba4c28792e2edb78862d
BLAKE2b-256 308d5df96d26d1b2b16c4bee30ec726fca4ca4f70e9b759dea88e56cc3a08a4a

See more details on using hashes here.

File details

Details for the file nimbuscasino-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nimbuscasino-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 32.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for nimbuscasino-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6416806a79b6aebd62dc279081b8318dd27f9b9c2ba3480fa66f6d6f5c5aa355
MD5 b243f52e957d38383888d59ce73c583a
BLAKE2b-256 9e9d58edf69632be7733a430a3fdf165fc74796839cf8b968c1d6da3ed0c50ab

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