cli

package
v0.65.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card

type Card struct {
	Suit  string
	Value string
}

Card represents a playing card with a suit and value.

type Deck

type Deck struct {
	Cards []Card
	Decks int // Number of decks in play
}

Deck represents a deck of cards.

type Game

type Game struct {
	AP          *ansipixels.AnsiPixels
	Playing     bool
	State       GameState
	Balance     int
	Bet         int
	BorderColor string
	BorderBG    string
	WideBorder  bool
	// contains filtered or unexported fields
}

Game represents the blackjack game state.

func (*Game) InitDeck

func (g *Game) InitDeck(numDecks int)

InitDeck initializes a new shuffled deck.

func (*Game) LeftMostCardPos

func (g *Game) LeftMostCardPos(numCards int) int

func (*Game) Run

func (g *Game) Run()

Run starts the game loop.

func (*Game) RunGame

func (g *Game) RunGame(ap *ansipixels.AnsiPixels) int

type GameState

type GameState int

GameState represents the current state of the game.

const (
	StatePlayerTurn GameState = iota
	StateDealerTurn
	StateGameOver
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL