util

package
v0.0.0-...-c841390 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const TileMax = 34

Variables

This section is empty.

Functions

func CheckTile

func CheckTile(tile []int) int

func IsM

func IsM(v int) bool

func IsP

func IsP(v int) bool

func IsS

func IsS(v int) bool

func IsSameType

func IsSameType(a, b int) bool

func IsZ

func IsZ(v int) bool

func LeftTiles34

func LeftTiles34(tile34 []int) []int

func NumToTile

func NumToTile(v int) []byte

func NumToTileStr

func NumToTileStr(v int) string

func StrToTile

func StrToTile(s *string) []int

func Tile34IsHu

func Tile34IsHu(tiles34 []int) bool

func TileToStr

func TileToStr(tile []int) string

Types

type MahjongResult

type MahjongResult struct {
	NumKe     int   // 刻子数量
	NumShun   int   // 顺子数量
	Jiang     int   // 将牌值(0-8{1-9万},9-17{1-9筒},18-26{1-9条})
	ArrayKe   []int // 刻子数组
	ArrayShun []int // 顺子数组

	IsQiDui         bool // 七对,包含龙七对(此时将牌值存了4张龙头牌)
	IsChurchmenPout bool // 九莲宝灯
	IsTongTan       bool // 通天(注意: 未考虑副露)
	IsRyanPeiKou    bool // 两杯口(IsRyanPeiKou == true 时 IsIiPeiKou == false)
	IsIiPeiKou      bool // 一杯口
}

func Tiles34Backtrack

func Tiles34Backtrack(tiles34 []int) (res []*MahjongResult)

func Tiles34Result

func Tiles34Result(tiles34 []int) (res []*MahjongResult)

func (*MahjongResult) String

func (mr *MahjongResult) String() string

type TileLine

type TileLine struct {
	Tile []int
	Line []string
}

func LoadTileFromFile

func LoadTileFromFile(p string) (res []TileLine)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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