Function onejoker::cards::hashes::ojh_bitfield_mp5_low

source ยท
pub fn ojh_bitfield_mp5_low(cards: &[Card]) -> u32
Expand description

wiki | Convert bitfield to MPH Given a bitfield with exactly 5 bits set, return the lexicographic index of that particular set of bits for minimal perfect hash. Low-ace deck version, 5 cards.

use onejoker::prelude::*;
use onejoker::cards::hashes::*;

let d = Deck::new(DeckType::Low);
let h = d.new_hand().init(hand!("Ac","Ad","Ah","As","2c"));
assert_eq!(1, ojh_bitfield_mp5_low(&h[..]));