Skip to content

About

Step behind the bet. Explore gambling risks through fictional games, transparent odds, and clearly labelled scripted outcomes. Built to encourage people to step away from gambling. Virtual credits. Real lessons. No claims about any operator.

Topics

Resources

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

Odds Lab

A gambling-awareness learning lab by Ramprasad Atluri. Explore how probability and payout rules produce a house advantage using five transparent, simplified models. Virtual credits only: no deposits, withdrawals, purchases, prizes, accounts, or gambling referrals.

Run

Requires Node.js 20 or newer. No third-party packages are needed.

npm start
# http://localhost:3000
npm test

Set PORT for your host. For static hosting, publish the public directory for the probability lab and workflow guide only. The backend control-room demo requires the Node server and cannot run on static-only hosting. All asset paths are relative. A build is not required. Use an HTTP server rather than opening the HTML directly because the app uses JavaScript modules.

Included

  • Mines: a fixed, randomly shuffled 25-tile board, adjustable mine count and safe-tile target, full-board reveal after settlement.
  • Dice: uniform outcomes 0–99; 0–48 succeed, with 2× total return.
  • Single-zero Roulette: fixed red selection, 18/37 success probability and 2× total return.
  • Crash: a target chosen before the round; a stop distribution with 97% expected return. No real-time cash-out or latency advantage.
  • Slots: three independent six-symbol reels; matching triples pay 34.2× total return.
  • Visible probability, return, expected loss, session accounting, accessible outcome history and CSV export.
  • Ten-observation session pause and reflection; 1,000-trial experimental charts with expected-value comparison.
  • Responsive, keyboard-accessible interface, reduced-motion support, print-friendly classroom memorandum.

Mathematics

All returns include the original 10-credit stake. Expected net = stake × (success probability × return multiplier − 1).

Model Probability of success Total return House advantage
Mines Product of (25-m-i)/(25-i) for i=0…k-1 0.97 / P 3%
Dice 49/100 2× 2%
Roulette red 18/37 2× 1/37 ≈ 2.70%
Crash target t 0.97/t t× 3%
Slots matching triple 6/216 34.2× 5%

Mines targets are fixed before the round. Ending early gives no return and is explicitly recorded; the published 3% edge assumes completing the chosen target. Within a Mines board, conditional probabilities change as tiles are revealed. Separate rounds are independent. Crash uses max(1, 0.97 / (1-U)) for U uniform in [0,1); targets range from 1.5× to 10× in the UI. These models are not claims about any commercial operator. Floating-point values are displayed to two decimals; CSV retains six.

A long-run expectation is not a guaranteed session result. The 1,000-trial experiment uses fresh independent samples and fixed stakes; it is not a bankroll or strategy prediction. Browser Web Crypto supplies randomness, including rejection sampling for integer outcomes. This is an educational implementation, not a certified gambling engine.

Workflow education and backend control room (v3)

  • /workflows.html: ten-stage representative journey (advertising, signup, verification, deposit, bonus, game selection, settlement, withdrawal, retention, exit), bonus-turnover calculator, net-loss framing example, transparent versus obstructive mock withdrawal, technical architecture and primary-source notes.
  • /control.html: each visitor creates a private-to-the-session teaching plan: random, always win, always lose, or a finite W/L sequence. All five game models are available as whole-round observations using the default lab parameters.
  • /api/demo/session: POST creates a temporary session, GET reads it, DELETE deletes it.
  • /api/demo/plan: PUT sets a plan before any rounds are recorded.
  • /api/demo/round: POST settles one observation. Requires a game and unique request ID; repeated IDs do not settle twice and mismatched games are rejected.

Except creation, API requests use Authorization: Bearer <session token>. Tokens are generated by Node crypto and stay only in the page's memory. Do not log or share them. The UI exports an audit without its token.

A server sample is taken first. In a scripted mode, the server then substitutes the visitor's disclosed plan and records both the sample and presented result. Forced rounds are not governed by the ordinary model's published win probability. A forced result is labelled even if it happens to match the sampled result. This is not a production gambling implementation, an undisclosed admin control, or a prediction tool. It does not modify the independent probability lab.

Plans lock after the first observation. Sequences stop at their final entry; all modes stop at 20 rounds. Sessions expire after 30 minutes, use bounded process memory, and disappear when the server restarts. New session creation is capped at 500 concurrent unexpired sessions. This single-process demonstration needs sticky routing if replicated; no shared database is provided.

Privacy and architecture

Plain HTML/CSS/ES modules plus a dependency-free Node server. No real accounts, identity documents, payments, deposits, prizes, analytics, cookies, or browser storage. The probability lab keeps observations in page memory; the control room additionally uses temporary backend session memory. Reloading loses the control-room token; the inaccessible session expires automatically. Export before leaving if needed.

The old globally shared outcome controls remain removed. New teaching endpoints are isolated by bearer token and always disclose overrides. Static assets use an allowlist and security headers. JSON requests have a 4 KiB limit; cross-origin browser requests are refused. Unknown routes and invalid input fail explicitly.

This is not hardened public infrastructure: a bounded in-memory capacity limit is not an abuse-prevention system. Before hosting for a large audience, configure HTTPS, request rate limits, proxy timeouts/body limits, monitoring, and appropriately scoped log retention at your hosting layer. No actual financial ledger or payment processor is included. Browser sessions and server audit reports are not independent proof that a third-party operator is fair.

Classroom memorandum

Use Print classroom memorandum for the discussion handout. A suggested 20-minute activity covers prediction, observations, a larger experiment, and reflection on streaks, near misses, and chasing losses. For younger learners, use with a teacher or trusted adult. No casino branding, leaderboards, celebratory sounds, promotional rewards, or payment flows are included.

Background reading: Gambling Commission — return to player and house edge. Model-specific percentages above are calculated from this project's own published rules.

Validation

npm test checks probability identities, exact enumeration of Dice/Roulette/Slots outcomes, Mines placement and bounds, Crash boundaries, experiment accounting, static assets, legacy-route removal, disclosed overrides across all five games, random passthrough, session isolation, immutable audit snapshots, sequence order, plan locking, idempotency, expiration, deletion, body validation, and origin rejection. For browser checks: try every model, change Mines/Crash parameters, reveal tiles, end a round, complete ten observations, reset, export CSV, run experiments, print, and check a narrow viewport.

About

Step behind the bet. Explore gambling risks through fictional games, transparent odds, and clearly labelled scripted outcomes. Built to encourage people to step away from gambling. Virtual credits. Real lessons. No claims about any operator.

Topics

Resources

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages