common

package
v0.0.0-...-6075cdd Latest Latest
Warning

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

Go to latest
Published: May 28, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertHandsToKey

func ConvertHandsToKey(cards []Card) string

func GenerateSubset5

func GenerateSubset5(cards []Card) [][]Card

func OrderToNum

func OrderToNum(s uint8) uint8

func SuitToNum

func SuitToNum(s uint8) uint8

Types

type Board

type Board []Card

type Card

type Card int32

func NewCard

func NewCard(s string) Card

func (Card) ToInt32

func (c Card) ToInt32() int32

func (Card) ToString

func (c Card) ToString() string

type CompareResult

type CompareResult int8
const (
	CompareResultUnknown CompareResult = 0
	CompareResultWin     CompareResult = 1
	CompareResultLose    CompareResult = 2
	CompareResultTie     CompareResult = 3
)

type Hand

type Hand []Card

type HandRanker

type HandRanker struct {
	Cards2Rank map[string]int64
}

func NewHandRanker

func NewHandRanker(filePath string) *HandRanker

func (*HandRanker) CompareHands

func (hr *HandRanker) CompareHands(h1 Hand, h2 Hand, board Board) (CompareResult, error)

func (*HandRanker) GetHandRank

func (hr *HandRanker) GetHandRank(hand Hand, board Board) (int64, error)

Jump to

Keyboard shortcuts

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