fifty2

package module
v0.0.0-...-483a45e Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2014 License: MIT Imports: 5 Imported by: 0

README

fifty2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Index

func Index(slice []Card, card Card) int

func Mask

func Mask(slice []Card) uint64

func Shuffle

func Shuffle(slice []Card)

Types

type Card

type Card struct {
	Rank Rank
	Suit Suit
}

func NewDeck

func NewDeck() []Card

func NewDeckSet

func NewDeckSet(decks uint) []Card

func Remove

func Remove(slice []Card, cards ...Card) []Card

func (Card) Mask

func (c Card) Mask() uint64

func (Card) String

func (c Card) String() string

type CardReader

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

func NewCardReader

func NewCardReader(reader io.Reader) *CardReader

func (*CardReader) Read

func (cr *CardReader) Read() (Card, error)

func (*CardReader) ReadAll

func (cr *CardReader) ReadAll() ([]Card, error)

type CardSlice2DIterator

type CardSlice2DIterator interface {
	HasNext() bool
	Next() [][]Card
}

func MultipleCombinations

func MultipleCombinations(slice []Card, choose []int) CardSlice2DIterator

type CardSliceIterator

type CardSliceIterator interface {
	HasNext() bool
	Next() []Card
}

func Combinations

func Combinations(slice []Card, choose int) CardSliceIterator

type Rank

type Rank uint8
const (
	Ace Rank = iota
	Two
	Three
	Four
	Five
	Six
	Seven
	Eight
	Nine
	Ten
	Jack
	Queen
	King
)

func ParseRank

func ParseRank(r rune) (Rank, error)

func Ranks

func Ranks() []Rank

func (Rank) Mask

func (r Rank) Mask() uint16

func (Rank) Rune

func (r Rank) Rune() rune

type Suit

type Suit uint8
const (
	Clubs Suit = iota
	Diamonds
	Hearts
	Spades
)

func ParseSuit

func ParseSuit(r rune) (Suit, error)

func Suits

func Suits() []Suit

func (Suit) Mask

func (s Suit) Mask() uint8

func (Suit) Rune

func (s Suit) Rune() rune

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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