Skip to content

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 30 Aug 21:45
· 19 commits to main since this release

Craps Sim 0.5.0 adds a strategy language. A betting strategy no longer has to be one of the eleven built in — you can write the one you actually argue about.

Added:

  • Write your own strategy. A strategy is a header and an ordered list of rules — on <trigger> when <condition>: <actions> — with pressing declared per bet stream. What the checkbox player could never say is now sayable: press the 6 on its own second hit, call the place bets off until the shooter makes a point, Martingale the don't pass while the place bets stay flat, stop at −$200 or +$150, bet the field only after two field numbers in a row. Design's new Rules tab builds one from typed slots where a syntax error is not representable, or you can type it as text; both edit the same thing, so neither can say something the other cannot hold. Four worked examples ship under Examples. Most of them are bad bets and one is deliberately superstitious — the app exists to show you that, and it cannot refute a belief it cannot express.

  • The Bench, on Replay: a strategy's night stepped roll by roll, with every rule that fired marked, every cent attributed to the rule that asked for it or to the table, every refusal explained in words, and a fire count per rule — so a rule that never fires says so, instead of quietly doing nothing while the distribution looks confident.

  • Strategies are saved and travel. Plain-text .craps files beside your preferences, and the shareable scenario sentence carries the strategy that played by name and content hash — playing "44 Inside, regressed" #9f3c1a2b. Paste someone's sentence and if your copy of that strategy has changed, it says so rather than running the wrong player.

  • The Explorer ranks your strategy too, as its own rows beside the curated eleven, and the Duel runs it against any of them on identical dice.

  • The table answers for itself. Strategies can read the buy-in, the table minimum and maximum, and the house rules in play, so a stop-loss can be half the buy-in rather than a dollar figure that is right at one table and quietly wrong at every other, and a strategy whose arithmetic assumes a particular field payout can decline a table that does not have it.

  • Working on the come-out, and a table setting for whether the point may be placed as well as covered by the line — off by default, because turning it on changes what every strategy that places numbers does.

Fixed:

The language was reviewed hard before release, and the review is in the repository at docs/STRATEGY_DSL_REVIEW.md alongside the design specification. Its worst findings were all the same shape — a strategy that compiled and then quietly played something other than what was written — and all of them are closed:

  • A stake below the table minimum was accepted, so a strategy asking for twelve dollars could ride for twelve cents through three hundred rolls without one refusal. Sub-minimum stakes are refused now, oversized ones are clipped where you can see it, and money is written back as money.
  • Presses could not climb. Pressing a bet to twice what it currently holds recomputed the same figure forever, which made every press-and-ride ladder in craps unreachable — including the one the shipped example's own description promised.
  • Rules written on the start of a session never fired, and declared starting values for memory were discarded. Both work.
  • Out-of-range numbers wrapped into valid ones: place 260 became a place 4, and total(263) fired on every seven. They are refused, and the message names the number.
  • Two ways to crash the app from pasted strategy text.
  • Refusals now name which action was refused and how much it asked for, and "not allowed right now" has been split into the actual rules of craps it was standing in for.

Full Changelog: v0.4.3...v0.5.0