onejoker library

Classes

Deck cards
A "live" Deck of cards that is used for a game.
DeckInterface cards
Common behavior for Deck-like objects.
Hand cards
Hand of cards associated with (and created from) a Deck.
HandEvaluator<V extends HandValue<HandLevelInterface>> poker
Base class for poker hand evaluation.
HandEvaluatorHigh poker
Evaluation functions for traditional "high" poker hands.
HandInterface cards
Common behaviors for hand-like objects.
HandIterator
HandLevelInterface
HandValue<L extends HandLevelInterface> poker
All the information resulting from the evaluation of a poker hand.
HandValueHigh poker
HandValue for traditional "high" poker hands.
MasterDeck cards
MasterDeck | wiki
OjRandom utilities
Simple implementation of xoshiro128++
OrphanHand cards
Hand of cards not associated with a Deck.

Enums

Card cards
Enum for cards and their basic methods. (see Card @ wiki)
HandLevelAceToFive
HandLevelActionRazz
HandLevelBadugi
HandLevelDeuceToSeven
HandLevelHigh
HandLevelStripped
Rank cards
Suit cards
Enum for card suits and their most basic methods. (see Suit @ wiki)
Troolean utilities
Basic Klene / Priest three-valued logic

Constants

coefficients → const List<int>
TFALSE → const Troolean
TTRUE → const Troolean
TUNKNOWN → const Troolean

Functions

cardsFromText(String text) Iterable<Card>
Parse a string of card text into a sequence of cards. Whitespace is ignored between cards, but is not allowed between rank and suit. Cards may be enclosed in square brackets.
ojBinomial(int n, int k) int utilities
Binomial coefficient for 0 <= n <= 64, 0 <= k <= 64 using lookup table
ojhBitfield64co(Iterable<Card> cards) int hashes
64-bit Bitfield hash
ojhFNV32(Iterable<Card> cards) int hashes
32-bit FNV-1a
ojhFNV64(Iterable<Card> cards) int hashes
64-bit FNV-1a
ojHighHandValueFunction(HandLevelInterface level, List<Rank> ranks) int
Default function for assigning a numeric value to the Hand such that lower number equals better hand.
ojhMp5English(int f) int hashes
Convert bitfiled into minimal perfect hash
ojhPositional32c(Iterable<Card> cards) int hashes
32-bit Positional hash
ojhPositional32cr(Iterable<Rank> ranks) int hashes
32-bit Positional ranks only
ojhPositional32cs(Iterable<Card> cards) int hashes
32-bit Positional suit-independent
ojhPositional64c(Iterable<Card> cards) int hashes
64-bit Positional hash
ojhPositional64cr(Iterable<Rank> ranks) int hashes
64-bit Positional ranks only
ojhPositional64cs(Iterable<Card> cards) int hashes
64-bit Positional hash
ojhPrime32cor(Iterable<Rank> ranks) int hashes
32-bit Prime hash
ojhPrime64co(Iterable<Card> cards) int hashes
64-bit Prime hash
ojhPrime64cor(Iterable<Rank> ranks) int hashes
64-bit Prime ranks hash
ojLowHandValueFunction(HandLevelInterface level, List<Rank> ranks) int
ojNextCombination(List<int> a, int n) bool utilities
Generate all k-combinations of n cards
ojShuffle<T>(List<T> items) → void utilities
Standard Fisher-Yates shuffle using our own PRNG.
ojSort<T extends Comparable>(List<T> a) → void utilities
Heapsort somewhat optimized for small sets, like a hand of cards.
pokerEvaluator(String name) HandEvaluator<HandValue<HandLevelInterface>> poker
Return a HandEvaluator by name.

Typedefs

HandLevelAceToSix = HandLevelDeuceToSeven
HandLevelManilla = HandLevelStripped
HandLevelMexican = HandLevelStripped
HandLevelPaiGow = HandLevelHigh
HandValueFactory<V> = V Function()