feat(core): Spider rules as a second card_game::Game implementation
Test / test (pull_request) Successful in 7m37s
Test / test (pull_request) Successful in 7m37s
Two-deck (104-card) Spider on the upstream Stack/Pile containers, exercising the multi-deck Card encoding for the first time: - SpiderGame: 10-pile deal (4x6 + 6x5), build-down-any-suit, same-suit-run pickup, deal-10 gated on no empty pile, automatic K->A run removal, win at 8 runs - SpiderSuits difficulty (1/2/4 suits over the same 104 cards); 1- and 2-suit games contain identical Card values by construction (documented — engine entity mapping will need positional keys) - Seeded deals via inline SplitMix64 + Fisher-Yates (core has no rand dep; Spider's seed space is deliberately self-contained) - SpiderGameState session wrapper mirroring GameState conventions: Result<_, MoveError> mutations, upstream undo/score bookkeeping, Microsoft-style scoring (500 base, -1/move, +100/run, -1/undo) - 17 unit tests + card-conservation/validity proptest over random legal walks; stacked-deal win-path test included Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ pub mod error;
|
||||
pub mod game_state;
|
||||
pub mod klondike_adapter;
|
||||
pub mod scoring;
|
||||
pub mod spider;
|
||||
|
||||
// Re-export the upstream types that cross the solitaire_core API boundary so
|
||||
// downstream crates (engine, wasm) can import from one place without a direct
|
||||
@@ -21,6 +22,13 @@ pub use klondike::{
|
||||
// former `solitaire_data::solver` wrapper module.
|
||||
pub use game_state::{DEFAULT_SOLVE_MOVES_BUDGET, DEFAULT_SOLVE_STATES_BUDGET, SolveOutcome};
|
||||
|
||||
// Spider rules (second `card_game::Game` implementation; engine UI is a
|
||||
// later phase — nothing outside solitaire_core consumes these yet).
|
||||
pub use spider::{
|
||||
SpiderConfig, SpiderGame, SpiderGameState, SpiderInstruction, SpiderScoring, SpiderStats,
|
||||
SpiderSuits,
|
||||
};
|
||||
|
||||
/// All four foundation slots, in slot order.
|
||||
///
|
||||
/// Canonical iteration source for `Foundation` — upstream `klondike` has no
|
||||
|
||||
Reference in New Issue
Block a user