addCard(card): Boolean - adds single card to hand.addCards(.cards): Boolean - adds multiple cards to hand.cards: Card - enumeration or array of cards static readonly RANK_MAX: Number - constant rank of max rank (ace).static readonly SUIT_MAX: Number - constant rank of max suit (spades).
equalByRank(card): Boolean - compares cards by rank.equalBySuit(card): Boolean - compares cards by suit.compare(card): Number - compares current card with given by rank, returns 1 if current is higher -1 if current is lower 0 if both are equal.rankOf(): Number - returns rank representation of card (card.rank property).toJSON(): Object - returns JSON representation of card.toString(): String - returns string representation of card.static create(suit, rank): Card | null - creates Card instance, returns null if suit or rank is not a number.Var txHoldem = require('tx-holdem/browser') Ĭompare combinations: const = require('tx-holdem') Ĭonst coll = HandsCollection.createCombinations(board, pocket) Ĭonsole.log('Highest is', ) See demo app import * as txHoldem from 'tx-holdem/browser' Since version 0.2.2 tx-holdem is available for browsers! This is the module for creating own Texas Holdem poker game! It allows you to track cards, compose hands, compare hands by combination and even calculate draw combinations.