This commit is contained in:
2026-05-15 06:21:17 -07:00
parent bf7dc7864d
commit 283ffc83b2
3 changed files with 13 additions and 3 deletions
+5
View File
@@ -6,6 +6,11 @@ pub trait Game {
fn process_instruction(&mut self, instruction: Self::Instruction); fn process_instruction(&mut self, instruction: Self::Instruction);
} }
/// An identifier which specifies the deck id, suit, and card value.
/// 2 bits for deck ID
/// 2 bits for suit ID
/// 4 bits for card Value
/// TODO: better encoding for slightly more decks
pub struct Card(u8); pub struct Card(u8);
pub struct CardValue(deranged::RangedU8<1, 13>); pub struct CardValue(deranged::RangedU8<1, 13>);
pub enum Suit { pub enum Suit {
+1 -1
View File
@@ -28,7 +28,7 @@ struct KlondikeMove {
src: KlondikePileId, src: KlondikePileId,
dst: KlondikePileId, dst: KlondikePileId,
} }
pub struct KlondikeGame { pub struct Klondike {
config: KlondikeConfig, config: KlondikeConfig,
state: KlondikeState, state: KlondikeState,
} }
+7 -2
View File
@@ -1,2 +1,7 @@
mod card_game; pub mod card_game;
mod klondike; pub mod klondike;
// test readme
#[doc = include_str!("../README.md")]
#[cfg(doctest)]
struct ReadmeDoctests;