Documentation ¶
Overview ¶
Package trigo provides the base for implementing a card game
Index ¶
- type Card
- type TriGo
- func (t *TriGo) Card(i int) Card
- func (t *TriGo) Deal()
- func (t *TriGo) DeckSize() int
- func (t *TriGo) Field() []Card
- func (t *TriGo) FieldCard(i int) Card
- func (t *TriGo) FieldMatches() int
- func (t *TriGo) IsMatch(candidate []int) bool
- func (t *TriGo) MatchesFound() int
- func (t *TriGo) Remove(match []int)
- func (t *TriGo) Shuffle()
- func (t *TriGo) State() ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TriGo ¶
type TriGo struct {
// contains filtered or unexported fields
}
TriGo represents an instance of a game and its state.
func NewFromSavedState ¶
NewFromSavedState returns a game instance initialized to the given state.
func (*TriGo) Card ¶
Card returns ith card from the set of all cards, or a blank card if i is out of range.
func (*TriGo) Deal ¶
func (t *TriGo) Deal()
Deal deals new cards to the field, expanding the field if necessary until at least one match is available.
func (*TriGo) FieldCard ¶
FieldCard returns the ith field card, or a blank card if i is out of range.
func (*TriGo) FieldMatches ¶
FieldMatches returns the number of matches in the field.
func (*TriGo) MatchesFound ¶
MatchesFound returns the number of matches found in the current game
func (*TriGo) Remove ¶
Remove removes a match from the field. Match is not verified. Use IsMatch() to check.