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/pipfile-experiment/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.1.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.1-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nimbuscasino-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 33100ce2e3edc80d761fe38138fa41652c3c35e18a53a9ca2300e5a102ec1624
MD5 2d4668ba81c354878f4f4bd774de05ba
BLAKE2b-256 8bd759934ebea8f2606bdb0303dfcc1fc81a1024743f1a7098da92487fd50a05

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nimbuscasino-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4c1247258c807eab4fc4f8f9b7bbe372183fd951fb7aaa98074047fad596d408
MD5 598d2188bd213faf8cb0903328bfbc02
BLAKE2b-256 a8a4f6c21515dd7240f5073bfa109cf7e22a09257b78a0a8d3e1ba3c1c6ef7ae

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