Observed since 20 Oct, 19:05 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
2-7 (Deuce-to-Seven) Lowball poker hand evaluator. Correctly handles aces high, straights/flushes count against you.
A JavaScript poker hand evaluator for 2-7 (Deuce-to-Seven) Lowball variants including Triple Draw and Single Draw.
npm install 27-lowball-evaluator
const { LowballHand } = require('27-lowball-evaluator');
const hand = LowballHand.solve(['7h', '5c', '4d', '3s', '2h']);
console.log(hand.descr); // "7-5-4-3-2 (Number One)"
console.log(hand.name); // "Seven Low"
console.log(hand.handTypeName); // "High Card"
console.log(hand.rank); // Lower is better
const { LowballHand } = require('27-lowball-evaluator');
// Returns: -1 if first wins, 1 if second wins, 0 if tie
const result = LowballHand.compare(
['7h', '5c', '4d', '3s', '2h'], // Number One
['8h', '6c', '4d', '3s', '2h'] // 8-low
);
console.log(result); // -1 (first hand wins)
const { LowballHand } = require('27-lowball-evaluator');
const hands = [
LowballHand.solve(['7h', '5c', '4d', '3s', '2h']),
LowballHand.solve(['8h', '6c', '4d', '3s', '2h']),
LowballHand.solve(['9h', '7c', '5d', '3s', '2h']),
];
const winners = LowballHand.winners(hands);
console.log(winners[0].descr); // "7-5-4-3-2 (Number One)"
const hand1 = LowballHand.solve(['7h', '5c', '4d', '3s', '2h']);
const hand2 = LowballHand.solve(['8h', '6c', '4d', '3s', '2h']);
hand1.beats(hand2); // true
hand1.ties(hand2); // false
hand1.compareTo(hand2); // negative (hand1 is better)
Cards are represented as strings: rank + suit
2, 3, 4, 5, 6, 7, 8, 9, T (or 10), J, Q, K, Ah (hearts), d (diamonds), c (clubs), s (spades)Examples: '7h', 'As', 'Td', '2c'
In 2-7 (Deuce-to-Seven) Lowball:
LowballHand.solve(cards)Create and evaluate a hand from an array of 5 card strings.
LowballHand.compare(cards1, cards2)Compare two hands. Returns -1 if first wins, 1 if second wins, 0 for tie.
LowballHand.winners(hands)Find winner(s) from an array of LowballHand instances. Returns array (can have multiple for ties).
hand.rank - Numeric rank (lower is better)hand.handType - Hand type constant (HIGH_CARD, ONE_PAIR, etc.)hand.handTypeName - Human-readable type ("High Card", "One Pair", etc.)hand.name - Short name ("Seven Low", "One Pair")hand.descr - Detailed description ("7-5-4-3-2 (Number One)")hand.cards - Original card arrayhand.sortedRanks - Ranks sorted high to lowMIT
Download counts and popularity will appear here as the collector receives them.
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 20 Oct, 19:05 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:1d553832d687841de446b4aff9ea6a74054ca48fe0d4419f92aee4a3ed5dc4d2