card

package
v0.0.0-...-6e231dc Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CombinedSuits = [8]rune{'♠', '♣', '♥', '♦', 's', 'c', 'h', 'd'}
View Source
var LetterSuits = [4]rune{'s', 'c', 'h', 'd'}
View Source
var Suits = [4]rune{'♠', '♣', '♥', '♦'}

Functions

func CompareHands

func CompareHands(a, b HandStrength) int

Function for comparing hands. Returns a positive value if hand a is stronger, a negative value if hand b is stronger, and 0 if both are equal

Types

type Card

type Card struct {
	// contains filtered or unexported fields
}

func (Card) Read

func (c Card) Read() string

Transforms the Card object into a readable string.

type Combination

type Combination struct {
	// contains filtered or unexported fields
}

type Deck

type Deck [52]Card

func BuildDeck

func BuildDeck(letters bool) (Deck, error)

Constructs deck.

func (Deck) Deal

func (d Deck) Deal(cardsUsed *int) Card

func (*Deck) Shuffle

func (d *Deck) Shuffle()

Shuffles deck.

type HandStrength

type HandStrength struct {
	PlayerId          int
	CombStrength      int
	CombName          string
	OrderedCardValues []int
}

func IdentifyCombinations

func IdentifyCombinations(playerId int, hand []Card) (HandStrength, error)

Checks for combinations in a hand

Jump to

Keyboard shortcuts

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