Documentation ¶
Index ¶
- Constants
- Variables
- func GetChar() []byte
- func New()
- type Card
- type Game
- func (BJ *Game) AskPlayerInsurance()
- func (BJ *Game) Clear()
- func (BJ *Game) DealNewHand()
- func (BJ *Game) DrawHands()
- func (BJ *Game) DrawPlayerBetOptions()
- func (BJ *Game) GameOptions()
- func (BJ *Game) GetNewBet()
- func (BJ *Game) GetNewDeckType()
- func (BJ *Game) GetNumDecks()
- func (BJ *Game) MoreHandsToPlay() bool
- func (BJ *Game) NeedToPlayDealerHand() bool
- func (BJ *Game) PayHands()
- func (BJ *Game) PlayDealerHand()
- func (BJ *Game) PlayMoreHands()
- func (BJ *Game) String() string
- type Hand
- func (h *Hand) CanDouble() bool
- func (h *Hand) CanHit() bool
- func (h *Hand) CanSplit() bool
- func (h *Hand) CanStand() bool
- func (h *Hand) DealCard()
- func (h *Hand) GetValue(softCount bool) int
- func (h *Hand) Hit()
- func (h *Hand) IsBlackjack() bool
- func (h *Hand) IsBusted() bool
- func (h *Hand) IsDone() bool
- func (h *Hand) Process()
- func (h *Hand) Stand()
- type SavedGame
- type Shoe
Constants ¶
View Source
const ( SavedGameFile = "bj.json" MinBet = 5.0 MaxBet = 1000.0 CardsPerDeck = 52 MaxPlayerHands = 7 MinNumDecks = 1 MaxNumDecks = 8 // h.count HardCount = false SoftCount = true // h.Status Unknown = -2 Lost = -1 Push = 0 Won = 1 )
Variables ¶
View Source
var CardFaces = [14][4]string{
{"🂡", "🂱", "🃁", "🃑"},
{"🂢", "🂲", "🃂", "🃒"},
{"🂣", "🂳", "🃃", "🃓"},
{"🂤", "🂴", "🃄", "🃔"},
{"🂥", "🂵", "🃅", "🃕"},
{"🂦", "🂶", "🃆", "🃖"},
{"🂧", "🂷", "🃇", "🃗"},
{"🂨", "🂸", "🃈", "🃘"},
{"🂩", "🂹", "🃉", "🃙"},
{"🂪", "🂺", "🃊", "🃚"},
{"🂫", "🂻", "🃋", "🃛"},
{"🂭", "🂽", "🃍", "🃝"},
{"🂮", "🂾", "🃎", "🃞"},
{"🂠", "", "", ""},
}
View Source
var ShuffleSpecs = []int{80, 81, 82, 84, 86, 89, 92, 95}
View Source
var Suits = [4]string{"Spades", "Hearts", "Diamonds", "Clubs"}
Functions ¶
Types ¶
type Game ¶
type Game struct { Shoe DealerHand Hand PlayerHands []Hand NumberOfDecks int CurrentPlayerHand int CurrentBet float64 Money float64 }
func (*Game) AskPlayerInsurance ¶
func (BJ *Game) AskPlayerInsurance()
func (*Game) DealNewHand ¶
func (BJ *Game) DealNewHand()
func (*Game) DrawPlayerBetOptions ¶
func (BJ *Game) DrawPlayerBetOptions()
func (*Game) GameOptions ¶
func (BJ *Game) GameOptions()
func (*Game) GetNewDeckType ¶
func (BJ *Game) GetNewDeckType()
func (*Game) GetNumDecks ¶
func (BJ *Game) GetNumDecks()
func (*Game) MoreHandsToPlay ¶
func (*Game) NeedToPlayDealerHand ¶
func (*Game) PlayDealerHand ¶
func (BJ *Game) PlayDealerHand()
func (*Game) PlayMoreHands ¶
func (BJ *Game) PlayMoreHands()
type Hand ¶
type Hand struct { *Game IsDealer bool HideDownCard bool Stood bool Played bool Paid bool Status int Bet float64 Cards []Card }
func (*Hand) IsBlackjack ¶
type Shoe ¶
func (*Shoe) CheckNeedToShuffle ¶
func (*Shoe) GetNextCard ¶
func (*Shoe) NewAcesJacks ¶
func (s *Shoe) NewAcesJacks()
func (*Shoe) NewRegular ¶
func (s *Shoe) NewRegular()
Click to show internal directories.
Click to hide internal directories.