camelcards

package
v0.0.0-...-e31e380 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeHighCard int = iota
	TypeOnePair
	TypeTwoPair
	TypeThreeKind
	TypeFullHouse
	TypeFourKind
	TypeFiveKind
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Hand

type Hand struct {
	Cards      string
	Bid        int
	Values     [5]int
	WildValues [5]int
}

func NewHand

func NewHand(cards string, bid int) (hand Hand)

func (Hand) Less

func (hand Hand) Less(other Hand) int

func (Hand) Type

func (hand Hand) Type() int

func (Hand) WildLess

func (hand Hand) WildLess(other Hand) int

func (Hand) WildType

func (hand Hand) WildType() int

type Solution

type Solution struct {
	Hands []Hand
}

func (*Solution) Meta

func (*Solution) Meta() solutions.Meta

func (*Solution) Parse

func (s *Solution) Parse(data []byte) (err error)

func (*Solution) Part1

func (s *Solution) Part1() (answer int, err error)

func (*Solution) Part2

func (s *Solution) Part2() (answer int, err error)

Jump to

Keyboard shortcuts

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