Function onejoker::cards::hashes::ojh_bitfield_mp4_low
source ยท pub fn ojh_bitfield_mp4_low(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. Low-ace deck version, 4 cards (for Badugi).
use onejoker::prelude::*;
use onejoker::cards::hashes::*;
let d = Deck::new(DeckType::Low);
let h = d.new_hand().init(hand!("Ac","Ad","Ah","As"));
assert_eq!(1, ojh_bitfield_mp4_low(&h[..]));