Commit Graph

149 Commits

Author SHA1 Message Date
funman300 0cdfa5446a feat(card_game): add optional serde feature for Deck, Suit, Rank, Card
Adds a `serde` Cargo feature that gates #[derive(Serialize, Deserialize)]
on the four primitive types: Deck, Suit, Rank, and Card.

- Deck / Suit / Rank: plain enum derives — serialize as variant name strings
- Card: newtype over NonZeroU8 with #[serde(transparent)], serializes as
  the raw packed byte (deck<<6 | suit<<4 | rank)

Without the feature the crate remains no_std-compatible and pulls no
additional dependencies. With it, serde 1.x (derive only, no std) is
added as an optional dep.

Downstream consumers enable with:
  card_game = { ..., features = ["serde"] }
2026-06-08 10:49:53 -07:00
Quaternions ccfcfd6ad3 fix clippy 1.96 lints 2026-05-29 17:43:04 -07:00
Quaternions 156bc8f9b2 card_game without Session is no_std 2026-05-29 17:14:57 -07:00
Quaternions f2f9085aaf use exhaustive match 2026-05-29 17:08:57 -07:00
Quaternions 0e2284e913 fmt 2026-05-29 17:05:27 -07:00
Quaternions 90e1a03962 add NUM_RANKS constant 2026-05-29 16:37:04 -07:00
Quaternions 44b5aa02b8 rename functions 2026-05-29 16:32:39 -07:00
Quaternions ef0936bee9 write more specific functions instead of using generics 2026-05-29 16:30:13 -07:00
Quaternions baab7cd220 add link to readme 2026-05-29 16:16:16 -07:00
Quaternions f4c4e350eb klondike v0.3.0 bump for solver 2026-05-29 14:54:18 -07:00
Quaternions fa098f0d86 card_game v0.4.0 solver 2026-05-29 14:52:58 -07:00
Quaternions 9a4f7e603a write G::Score 2026-05-29 14:47:59 -07:00
Quaternions e43041711a rename state to session 2026-05-29 14:41:57 -07:00
Quaternions b8b8dfd95a Merge pull request 'Implement solver' (#14) from win2 into master
Reviewed-on: #14
2026-05-29 21:33:33 +00:00
Quaternions e3870112cf clean solution 2026-05-29 14:22:58 -07:00
Quaternions 9f6514367d implement solve budget 2026-05-29 14:22:42 -07:00
Quaternions 1de633adb3 implement solver 2026-05-29 14:21:18 -07:00
Quaternions 50cf2f3750 klondike v0.2.0 improved scoring + config 2026-05-29 13:24:41 -07:00
Quaternions 0f12e8dbd2 fix doc 2026-05-29 13:23:40 -07:00
Quaternions 31e7cdbc6f card_game v0.3.0 improved scoring + config 2026-05-29 13:23:15 -07:00
Quaternions 64a94c6072 Implement improved scoring (#13)
Closes #10

Reviewed-on: #13
Co-authored-by: Rhys Lloyd <krakow20@gmail.com>
Co-committed-by: Rhys Lloyd <krakow20@gmail.com>
2026-05-29 20:18:57 +00:00
Quaternions c9c341e926 Add MoveFromFoundationConfig option to KlondikeConfig (#12)
Closes #11

Reviewed-on: #12
Co-authored-by: Rhys Lloyd <krakow20@gmail.com>
Co-committed-by: Rhys Lloyd <krakow20@gmail.com>
2026-05-29 18:59:26 +00:00
Quaternions 035875c893 display game vertically 2026-05-27 22:39:50 -07:00
Quaternions 5ab1b8bac7 stock face down does not matter for trivial win 2026-05-26 22:39:46 -07:00
Quaternions a80f2ae3c9 tableau_face_down_cards tableau_face_up_cards functions 2026-05-26 22:34:14 -07:00
Quaternions 555daf5ec3 use custom arrayvec 2026-05-24 10:36:15 -07:00
Quaternions 555e7ef11c update readme 2026-05-19 16:46:32 -07:00
Quaternions f49721e415 no repr 2026-05-19 07:42:34 -07:00
Quaternions 90f8fe2e77 1000 games 2026-05-18 16:45:49 -07:00
Quaternions 7f708df327 stats histogram 2026-05-18 16:43:45 -07:00
Quaternions 6bfa05c292 add benchmark 2026-05-18 15:57:53 -07:00
Quaternions da0dfe98c4 update readme 2026-05-18 15:51:17 -07:00
Quaternions b840d56725 use workspace lints 2026-05-18 15:43:32 -07:00
Quaternions 37837e76c1 use get_auto_move in readme 2026-05-18 14:04:58 -07:00
Quaternions e6113b6e91 tweak doc 2026-05-18 13:57:47 -07:00
Quaternions 5cb5cb9a50 tweak doc 2026-05-18 13:43:39 -07:00
Quaternions 446cd87665 update readme 2026-05-18 13:34:03 -07:00
Quaternions a9b93f3807 update readme 2026-05-18 13:29:59 -07:00
Quaternions 13bc36ce0c tweak with_rng signature to allow Rng reuse 2026-05-18 13:28:40 -07:00
Quaternions 07c3dc6667 fix doc 2026-05-18 13:26:08 -07:00
Quaternions 835a4dcc5f fix registry 2026-05-18 13:15:11 -07:00
Quaternions ec25f11ca5 card_game v0.2.0 2026-05-18 13:12:19 -07:00
Quaternions f8dd9e008c workspace dependencies 2026-05-18 13:12:03 -07:00
Quaternions 90d46902ea move auto moves into klondike 2026-05-18 13:08:15 -07:00
Quaternions fd6b2a23ea add is_win_trivial 2026-05-18 13:00:15 -07:00
Quaternions e9bb9660a8 fix is_win 2026-05-18 12:56:37 -07:00
Quaternions 5a52f2ab7a temporarily remove is_winnable because it doesn't work 2026-05-18 12:53:27 -07:00
Quaternions e014c3496d fix readme 2026-05-18 12:51:39 -07:00
Quaternions 2463e1a8f6 move test 2026-05-18 12:50:19 -07:00
Quaternions 2b305227c9 add readme 2026-05-18 12:47:16 -07:00