Documentation ¶
Index ¶
- func BetterThan(h1 HandScore, h2 HandScore) int
- func CalculateOdds(hand []Card, sharedCardsInput []Card) float64
- func Contains(s []int, e int) bool
- func DeckContains(deck []Card, c Card) bool
- func ExpoFunction(odds float64, index float64) float64
- func FindStraight(c []int) int
- func FlushOdds(cc []Card, hand []Card, remainingCardsNb float64) float64
- func FourOfAKindOdds(groupByValues map[int]int, hs HandScore, hand []Card, remainingCardsNb float64) float64
- func FullHouseOdds(groupByValues map[int]int, hs HandScore, hand []Card, remainingCardsNb int) float64
- func HighCardOdds(cc []Card, hand []Card, remainingCardsNb float64) float64
- func IndexOf(s []int, e int) int
- func InstantOddsToLose(handInput []Card, sharedCards []Card) float64
- func MaxInt(a int, b int) int
- func MinInt(a int, b int) int
- func NormaleLawRandomization(risk float64, offset float64) float64
- func OrderSliceOfInt(s []int) []int
- func OrderSliceOfIntDesc(s []int) []int
- func PairOdds(group map[int]int, hs HandScore, hand []Card, remainingCardsNb int) float64
- func Play(client *ws.Client, r *Round, playerIndex int, bigBlind int, ...)
- func PrintDeck(client *ws.Client, d []Card)
- func RaiseExpo(x float64) float64
- func RatioStacks(stack float64, opponentStack float64) float64
- func RatioToWintoBet(amountToBet float64, pot float64) float64
- func ShowCards(client *ws.Client, sp []Player)
- func StraightFlushOdds(sc []Card, h []Card) float64
- func StraightOdds(commonCards []Card, hs HandScore, hand []Card) float64
- func ThreeInARowOdds(group map[int]int, hs HandScore, hand []Card, remainingCardsNb float64) float64
- func TwoPairsOdds(group map[int]int, hs HandScore, hand []Card, remainingCardsNb float64) float64
- type Broker
- type Card
- type Coefficients
- type Config
- type Croupier
- type Game
- func (g Game) BetBlinds(client *ws.Client, botMode bool)
- func (g *Game) EndRound(client *ws.Client, botMode bool)
- func (g Game) GetNumberOfPlayersAlive() int
- func (g Game) GetWinner() string
- func (g Game) GetWinnerIndex() int
- func (g Game) IsGameOn() bool
- func (g *Game) NewRound(client *ws.Client, botMode bool)
- type HandScore
- type Person
- type Player
- type PlayerResult
- type Result
- type Round
- type RoundResults
- type SidePot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BetterThan ¶
func CalculateOdds ¶
calculates the odds that we hav a better hand than the opponent -- if we are before the flop, the odds are taken from the initialOdds2players file the odds inside are statistics of wining with each hand calculated in 100,000,000 rounds
func DeckContains ¶
func ExpoFunction ¶
func FindStraight ¶
func FlushOdds ¶
returns the odds that the opponent has a flush. If we have a flush, it only returns the odds that the opponent has a better flush
func FourOfAKindOdds ¶
func FourOfAKindOdds(groupByValues map[int]int, hs HandScore, hand []Card, remainingCardsNb float64) float64
returns the odds that the opponent has a four of a kind. If we have a four of a kind, it only returns the odds that the opponent has a better one
func FullHouseOdds ¶
func FullHouseOdds(groupByValues map[int]int, hs HandScore, hand []Card, remainingCardsNb int) float64
returns the odds that the opponent has a full house. If we have a full house, it only returns the odds that the opponent has a better one
func HighCardOdds ¶
returns the odds that the opponent has the best hand without even a pair.
func InstantOddsToLose ¶
calculates the odds that ont opponent has a better hand than ours
func NormaleLawRandomization ¶
func OrderSliceOfInt ¶
func OrderSliceOfIntDesc ¶
func RatioStacks ¶
func RatioToWintoBet ¶
func StraightFlushOdds ¶
returns the odds that the opponent has a straight flush. If we have a straight flush, it only returns the odds that the opponent has a better straight flush
func StraightOdds ¶
returns the odds that the opponent has a straight. If we have a straight, it only returns the odds that the opponent has a better one
Types ¶
type Broker ¶
type Broker struct{}
Broker manages the internal state of the Croupier service.
type Coefficients ¶
type Game ¶
type Game struct { Players []Person Rounds []Round SmallBlindTurn int BigBlindTurn int DealerTurn int SmallBlindValue int BigBlindValue int TotalStack int }
func LaunchGame ¶
func LaunchGame() Game
func (Game) GetNumberOfPlayersAlive ¶
func (Game) GetWinnerIndex ¶
type HandScore ¶
type HandScore struct { Score int Suit string Card1 int Card2 int RemainingCards []int PlayerIndex int IsPrecedentEqual bool }
func CalculateFiveBestCards ¶
type PlayerResult ¶
func OrderResultsWithMaxWins ¶
func OrderResultsWithMaxWins(prs []PlayerResult) []PlayerResult
type Result ¶
type Result struct { Position int PlayerResults []PlayerResult }
type Round ¶
type Round struct { Players []Player Deck []Card Pot int MaxBet int PlayersAlive int PlayersAllIn int LimitBet int }
func (Round) GetResults ¶
func (r Round) GetResults() RoundResults
func (Round) IsBetTurnOver ¶
type RoundResults ¶
type RoundResults = [][]PlayerResult