A classic BlackJack card game library in GO
Go package can be used to run a blackjack game. It is also an exercise in Object Oriented Design and Test-driven Development
add: import "github.com/vtrung/blackjack-go/src/blackjack"
run in package directory: 'go test'
see blackjack_test.go for testing parameters
- Name string
- Value int
- *.Display() - Print the name of the Card
- Constructor NewDeck() - generate a new deck class
- Cards []Card
- New() - discard current Cards and grab a new deck of card
- Shuffle() - shuffle/randomized the order of Cards
- Draw() - return a single card from the deck and remove it
- Count() - count number of cards remaining in deck
- Constructor NewHand()
- Cards []Card
- ReceiveCard(card Card) - Recieve card and place it in hand
- Count() - return int. Count of card in hand
- Value() - return int. Highest Blackjack hand value
- IsBlackJack() - return bool. Is this hand a blackjack
- Discard() - drop cards
- Display() - prints cards in hand
- Constructor NewPlayer(name string)
- Name string
- Hand Hand
- Hold bool
- ReceiveCard(card *Card) - take card and place in hand
- Prompt() - print users cards
- Inherits Player
- Constructor NewDealer()
- DealCard() - return Card. draw a card from the deck and return it
- GetNewDeck() - discard current deck and get a new shuffled deck
- Constructor NewGame()
- StartGame() - Start first phase of blackjack game, pass 2 cards to each player and dealer
- NextRound() - Print cards of each player
- AddPlayer(player Player) - Add player to game
- PlayerCount() - return int. number of players in game
- Evaluate() - evaluate value of all players and dealer and determine win/lose/draw
- EndGame() - End game by discard hands and grabbing new deck