Function onejoker::cards::hashes::ojh_bitfield_mp4_english
source ยท pub fn ojh_bitfield_mp4_english(cards: &[Card]) -> u32
Expand description
wiki | Convert bitfield to MPH Given a bitfield with exactly 4 bits set, return the lexicographic index of that particular set of bits for minimal perfect hash. High-ace deck version, 4 cards (for Badugi).
use onejoker::prelude::*;
use onejoker::cards::hashes::*;
let d = Deck::new(DeckType::English);
let h = d.new_hand().init(hand!("2c","2d","2h","2s"));
assert_eq!(1, ojh_bitfield_mp4_english(&h[..]));