day_07

package
v0.0.0-...-0235693 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const HandChars = "AKQJT98765432"
View Source
const HandCharsPart2 = "AKQT98765432J"

Variables

This section is empty.

Functions

func CharRank

func CharRank(r rune) int

func CharRankPart2

func CharRankPart2(r rune) int

func CompareHands

func CompareHands(h1, h2 Hand) int

func CompareHandsPart2

func CompareHandsPart2(h1, h2 Hand) int

func IsValidHand

func IsValidHand(s string) bool

func Part1

func Part1()

func Part2

func Part2()

Types

type Hand

type Hand string

type HandBid

type HandBid struct {
	Hand Hand
	Bid  int
}

type HandType

type HandType int
const (
	HighCard HandType = iota + 1
	OnePair
	TwoPair
	ThreeOfAKind
	FullHouse
	FourOfAKind
	FiveOfAKind
)

func ClassifyHand

func ClassifyHand(h Hand) HandType

func ClassifyHandPart2

func ClassifyHandPart2(h Hand) HandType

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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