Skip to content

fix: one-sided dice and empty penetrating dice - #13

Merged
darkliquid merged 2 commits into
masterfrom
fix/onesided-and-penetrating
Oct 6, 2026
Merged

darkliquid merged 2 commits into
masterfrom
fix/onesided-and-penetrating

Conversation

@darkliquid

Copy link
Copy Markdown
Owner

Summary

  • Supports one-sided dice: d1 is deterministic, so it is folded to its fixed value without rolling and skips rerolls/explosions, which stops 4d1! / 4d1r1 from looping forever. Only a size of zero or less is still rejected.
  • Drops penetrating dice whose reduced face reaches zero from the results instead of showing a zero. The dropped die contributed 0, so the total is unchanged.

Adds onesided_test.go, updates the penetrating spec expectations (plus a kept-reduction case), and rebuilds the wasm bundle.

Fixes #12
Fixes #9

💘 Generated with Crush

A one-sided die is deterministic, so it is folded to its fixed value
without being rolled and skips rerolls and explosions, which lets d1
work without looping forever. A penetrating die whose reduced face
reaches zero can no longer be rolled, so it is dropped from the results
instead of appearing as a zero.

Fixes #12
Fixes #9

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4.1-flash
Record the new one-sided die and penetrating-zero semantics in the
design spec and implementation plan.

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4.1-flash
@darkliquid
darkliquid merged commit b3ec5d3 into master Oct 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support 1 sided die Penetrating dice that reach size 0 are still included in results

1 participant