Categorygithub.com/DanTulovsky/deck
modulepackage
0.0.0-20211022030233-f51771ba6d21
Repository: https://github.com/dantulovsky/deck.git
Documentation: pkg.go.dev

# README

deck

Card Deck

# Functions

CardFromProto returns a *Card from ppb.Card.
CardInList returns true if c is in l.
CardsByRank returns a map of rank -> []*Card with that rank.
CardsEqual compares two slices of Cards, order matters.
CardsFromProto returns a []Card from []*ppb.Card.
CardsImage combines all the cards into a single horizontal image and returns it.
CardsToProto returns cards in a proto.
CountByRank returns a map of rank -> number present.
CountBySuit returns a map of suit -> number present.
NewCard returns a new card.
NewDeck returns a new, unshuffled deck of cards.
NewRandomCard returns a random card.
NewShuffledDeck returns a shuffled deck.
RandomCard returns a random card (not from a deck).
RandomRank returns a random rank.
RandomRankAbove returns a random rank that is > r.
RandomRankNotIn returns a random rank that is not in ranks.
RandomSuit returns a suit at random.
RandomSuitNotIn returns a suit at random not in suits.
RankInList returns true if r is in l.

# Variables

Divider is the divider between the hole and board in the terminal.

# Structs

Card is a card.
Deck is a deck of cards.

# Type aliases

SortByCards puts the cards in order Low -> High: 2 -> Ace Low -> High: Spade, Club, Diamond, Heart.