freezeout_eval/lib.rs
1// Copyright (C) 2025 Vince Vasta
2// SPDX-License-Identifier: Apache-2.0
3
4//! Freezeout Poker hand evaluator.
5//!
6//! Poker hand evaluator for 5, 6 and 7 cards hands. This evaluator is a port of
7//! the [Cactus Kev's][kevlink] poker evaluator with an additional lookup table
8//! for faster 7 cards evaluation (see examples for measuring single and parallel
9//! performance on you hardware).
10//!
11//! To use the evaluator create a hand and use [HandValue] to evaluate the hand
12//! and get its rank:
13//!
14//! ```
15//! # use freezeout_eval::*;
16//! // 2C, 3C, .., JC
17//! let cards = Deck::default().into_iter().take(10).collect::<Vec<_>>();
18//! let v1 = HandValue::eval(&cards[0..5]);
19//! let v2 = HandValue::eval(&cards[5..]);
20//! assert!(v2 > v1);
21//!
22//! ```
23//!
24//! [kevlink]: http://suffe.cool/poker/evaluator.html
25#![warn(clippy::all, rust_2018_idioms, missing_docs)]
26pub mod eval;
27pub use eval::{HandRank, HandValue};
28
29// Reexport cards types.
30pub use freezeout_cards::{Card, Deck, Rank, Suit};