All projects

The Mandalay Bay

Side project · game systems & simulation

The repository is called degen-llms. The name is tongue-in-cheek. There is no language model in it.

Satire only. Chips are fictional and nothing here uses real money. This project is not affiliated with MGM Resorts International or the real Mandalay Bay.

At a glance

3 surfaces on one wallet: Python CLI, browser terminal, pixel RPG

282 + 12 pytest tests and Node smoke scripts (CI runs 7 of the 12)

744 futures and options contracts, among 37 slot machines and 8 floors

The problem

I wanted a game big enough to be a real software project: many small activities, one economy, and a save that survives. It is a resort where you pick a floor, play a game, spend chips on a room or a meal, and see the result on your balance. The joke is the setting. The work is keeping dozens of features consistent.

Two things made it hard. The game has to run as a command-line program and in a browser. And a pixel-art overworld on top must not become a third copy of every screen.

Approach

The Python package is the reference for the rules and needs only the standard library, Python 3.11 or later. The browser terminal is a hand-written port in vanilla JavaScript ES modules. It is not Python compiled to run in the browser. The two sides share a save format, not a live store.

The pixel RPG follows one rule: it never rebuilds a game screen. Each screen is written once as a factory, buildXRenderers(ctx), and both the terminal and the RPG overlay mount it. A feature added to the terminal shows up in the RPG with no RPG work. Four screens are the exception because they read better in the world: blackjack, hold’em, roulette and the House of Blues rhythm game.

What I built

Results

A dark browser terminal page titled The Mandalay Bay. It shows a floor chip balance, a list of venues such as Table Games, Slot Machines and Sports Book, and a numbered Choose your adventure menu.

The terminal’s front page: floor chips, the games on the floor today and a numbered menu.

A dark terminal menu headed Table Games listing Blackjack, Texas Hold'em and Mandalay Roulette with minimum chips and a one-line description for each, plus a Back option.

The table games menu: blackjack, Texas hold’em and roulette, each with a minimum bet.

These captures come from an earlier build, when the front page listed five venues. The live demo has more.

Heads up. The slot machines pay more than they take on purpose. A test pins one machine’s return between 155% and 185%, and exact enumeration over all 37 machines puts every one above 100% in the base game (about 168% at the low end). That is a satire economy, not realistic casino odds, and it should not be used to learn how real slots behave.

What I learned

Stack

Python JavaScript (ES modules) Phaser pytest Node GitHub Actions GitHub Pages