Documentation ¶
Index ¶
- Variables
- func CompareTwoBestFive(firstFive, secondFive Cards) (int, error)
- type ByNumber
- type Card
- type Cards
- type Deal
- type Deck
- func (d *Deck) BurnAndFlip(numCards int) Cards
- func (d *Deck) Deal(numHands, numCards int) Hands
- func (d *Deck) DealHoldEm(numHands int) Hands
- func (d *Deck) GetCard() Card
- func (d *Deck) GetDeal(numPlayers int) Deal
- func (d *Deck) GetFlop() Cards
- func (d *Deck) GetRiver() Cards
- func (d *Deck) GetTurn() Cards
- func (d Deck) PrintOrder()
- func (d Deck) PrintRemainingCards()
- func (d *Deck) Reset()
- func (d *Deck) Shuffle()
- type HandResult
- type Hands
- type Player
- type Players
Constants ¶
This section is empty.
Variables ¶
var (
MIN_SPACE = 16
)
Functions ¶
func CompareTwoBestFive ¶
CompareTwoBestFive compares two hands returns 1 if first hand best, 2 if second hand best and 0 if hands are the same (in evaluation, not necessarily identical) errConstant if error
Types ¶
type Cards ¶
type Cards []Card
Cards is a list of Card objects. It can be used as a deck or a hand
func GetFiveBest ¶
GetFiveBest evaluates the hand and prints out what it is First return param: the 5 best cards Second return param: the ranking of the 5 best cards. Rankings can be found above
func (*Cards) Add ¶
Add adds cards to a Cards object. This is intended to be used for failed multistep checks (fullhouse, two pair)
type Deal ¶
type Deal struct { Hands Hands `json:"hands"` Board Cards `json:"board"` HandResults []HandResult `json:"results"` }
Deal is the cards for the flop, turn, river and hands dealt to each player
func (*Deal) PrintBoardAndHands ¶
func (d *Deal) PrintBoardAndHands()
PrintBoardAndHands prints the board and the hands
func (*Deal) PrintRanksAndBestFive ¶
func (d *Deal) PrintRanksAndBestFive()
type Deck ¶
Deck is a Cards object and the next card to use
func (*Deck) BurnAndFlip ¶
BurnAndFlip takes in a parameter that is the number of cards to get It first skips a card then grabs the desired number of cards
func (*Deck) Deal ¶
Deal takes in the number of hands and the number of cards per hand and creates the hands from the deck, updating the next card as it goes
func (*Deck) DealHoldEm ¶
DealHoldEm deals 2 cards to the number of hands passed in eg: if 6 is passed in, it will return 6 hands of 2
func (*Deck) GetCard ¶
GetCard gets the next card in a deck and updates the index of the deck object
func (Deck) PrintRemainingCards ¶
func (d Deck) PrintRemainingCards()
PrintRemainingCards prints the remaining cards in the deck
type HandResult ¶
HandResult is the player number and the hand that they had This keeps track of the relative rank between players and the type of hand that they have