playing_cards/
lib.rs

1#![warn(missing_docs)]
2
3//! # playing-cards
4//!
5//! `playing-cards` is a library for developing card games, ranging from dealing cards from a
6//! deck to hand evaluations.
7//!
8//! ## DISCLAIMER
9//! This library is still in early development. A lot of features may be subject to breaking
10//! changes across minor version changes. Be sure to check the docs for updates on any changes.
11//!
12//! ## MSRV (Minimum Supported Rust Version)
13//! Requires rustc 1.62+
14//!
15//! ## Breaking Changes in v0.1.0
16//! - Rank types are now primarily used for storing hand rankings instead of `u64`s.
17//! - The `Evaluator` trait has been removed.
18//! - All evaluators in `poker::evaluators` have changed to be standalone functions rather than
19//! structs. Evaluator functions can differ in signature, primarily due return type, but also
20//! arguments.
21//! - `get_string()` has been removed in favor of having the rank string computed on `Rank`
22//! construction. Please see `BasicRank::description`.
23//!
24//! ## Some extra changes in v0.1.0
25//! - The High Evaluator now uses the Cactus-Key Perfect Hash algorithm to calculate rank strength.
26//! While the 2+2 evaluator is in theory faster, compilation times for this library were extremely
27//! high when generating the graph, the amount of RAM and disk space of containing such codegen was
28//! too impractical and did not outweigh the minor performance improvement.
29//! - `poker::ranks::generate_winner_list()` can be used to calculate the winners given the
30//! associated ranks of each player.
31//! - `core::CardDeck` now uses the Xoshiro256PlusPlus PRNG instead of SFMT and now requires a
32//! 256-bit seed rather than a 64-bit seed.
33//!   - The reason why the seed width has increased is to ensure a chance for all possible deck
34//!   permutations. A 64-bit key only has the ability of replicating a very small fraction of these
35//!   permutations. In terms of likelihood, this shouldn't drastically change your likelihood of
36//!   getting a straight flush, but it brings it a bit closer to how a normal deck would function
37//!   in real life.
38//! - Added the following evaluators:
39//!   - 2-7 Low
40//!   - Omaha Hi
41//!   - Omaha Hi-Lo
42//!   - Dramaha High
43//!   - Badugi
44//!
45//! ## Features
46//! * `core`: A default feature that includes the core module
47//! * `poker`: The poker module
48//! * `serde`: Adds serde-related traits to structs
49
50#![cfg_attr(feature = "unstable", feature(test))]
51
52#[cfg(all(feature = "unstable", test))]
53extern crate test;
54
55#[macro_use]
56extern crate num_derive;
57
58pub mod core;
59
60#[cfg(feature = "poker")]
61pub mod poker;
62
63#[cfg(test)]
64mod tests {}