#[non_exhaustive]pub struct Rules {
pub knock_limit: u8,
pub oklahoma: Option<OklahomaAce>,
pub gin_bonus: u16,
pub big_gin_bonus: Option<u16>,
pub undercut_bonus: u16,
pub undercut_on_tie: bool,
pub box_bonus: u16,
pub immediate_boxes: bool,
pub game_bonus: u16,
pub game_target: u16,
pub shutout: Shutout,
}Expand description
The scoring rules of a game
All fields are public knobs; see the module documentation for the preset-and-adjust pattern.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.knock_limit: u8The most deadwood a knocker may keep: 10 in every common school,
and 0 plays straight gin — only a gin knock ends the round
oklahoma: Option<OklahomaAce>Oklahoma gin: the opening upcard caps the knock limit at its
deadwood value (pictures 10, aces per OklahomaAce), or None
for a fixed knock_limit
No preset turns this on; enable it atop any of them. Some tables also double the hand score on a spade upcard — not modeled yet.
gin_bonus: u16Bonus for going gin: 25 modern and palace, 20 classic
big_gin_bonus: Option<u16>Bonus for big gin — 11 melded cards declared instead of discarding —
or None where the variant is not played (classic, palace)
undercut_bonus: u16Bonus for undercutting the knocker: 25 modern, 10 classic, 20 palace
undercut_on_tie: boolWhether the defender undercuts on equal deadwood (all three presets say yes; some traditional tables require strictly less)
box_bonus: u16Bonus per won hand: 25 modern, 20 classic, 10 palace
immediate_boxes: boolWhen true, the box bonus is credited to the running score as each
hand is won, counting toward game_target (Gin
Rummy Palace); when false, boxes are tallied only at game end
(traditional)
game_bonus: u16Bonus to the winner of the game: 100 traditionally, 0 palace
game_target: u16The score that ends the game: 100 traditionally; house games play to 150 or 250, and Gin Rummy Palace offers 10 through 500
shutout: ShutoutThe shutout (blitz, schneider) rule for games whose loser never scored
Implementations§
Source§impl Rules
impl Rules
Sourcepub const fn classic() -> Self
pub const fn classic() -> Self
Classic scoring per Bicycle: smaller bonuses, no big gin, and a flat 100-point shutout bonus
Sourcepub const fn palace() -> Self
pub const fn palace() -> Self
Gin Rummy Palace app scoring: boxes of 10 credited immediately, no game or shutout bonus
The app lets players set the target between 10 and 500; adjust
game_target to taste.
Sourcepub const fn knock_limit_for(&self, initial_upcard: Card) -> u8
pub const fn knock_limit_for(&self, initial_upcard: Card) -> u8
The knock limit in effect for a round opened by initial_upcard
Under oklahoma the upcard’s deadwood value caps
knock_limit — the house limit only ever
tightens, never widens; without Oklahoma it passes through
unchanged. Round::knock_limit
resolves this per round.