mathtoolset

package
v0.10.18 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnkonow - unknow error
	ErrUnkonow = errors.New("unknow error")

	// ErrInvalidReel - invalid reel
	ErrInvalidReel = errors.New("invalid reel")

	// ErrInvalidInReelSymbolType - invalid InReelSymbolType
	ErrInvalidInReelSymbolType = errors.New("invalid InReelSymbolType")
)

Functions

func CalcSymbolWins

func CalcSymbolWins(rss *ReelsStats, wilds []SymbolType, symbol SymbolType, symbol2 SymbolType, lst []InReelSymbolType) (int64, error)

lst is like [S, W, S+W, No S+W, All]

func CalcSymbolWinsInReelsWithLine

func CalcSymbolWinsInReelsWithLine(paytables *sgc7game.PayTables, rss *ReelsStats, symbols []SymbolType,
	wilds []SymbolType, symbol SymbolType, num int, wildPayoutSymbol SymbolType) (int64, error)

CalcSymbolWinsInReelsWithLine - symbol 不可能是 wild

func HasSymbol

func HasSymbol(symbols []SymbolType, symbol SymbolType) bool

func IsFirstWild

func IsFirstWild(lst []InReelSymbolType, num int) bool

Types

type InReelSymbolType

type InReelSymbolType int
const (
	IRSTypeAll               InReelSymbolType = 0
	IRSTypeSymbol            InReelSymbolType = 1
	IRSTypeWild              InReelSymbolType = 2
	IRSTypeSymbolAndWild     InReelSymbolType = 3
	IRSTypeNoSymbolAndNoWild InReelSymbolType = 4
	IRSTypeNoWild            InReelSymbolType = 5
	IRSTypeSymbol2           InReelSymbolType = 6
	IRSTypeSymbol2AndWild    InReelSymbolType = 7
)

func NewInReelSymbolTypeArr

func NewInReelSymbolTypeArr(num int) []InReelSymbolType

type ReelStats

type ReelStats struct {
	MapSymbols     map[SymbolType]*SymbolStats
	TotalSymbolNum int
}

func BuildReelStats

func BuildReelStats(reel []int) (*ReelStats, error)

func NewReelStats

func NewReelStats() *ReelStats

func (*ReelStats) GetSymbolStats

func (rs *ReelStats) GetSymbolStats(symbol SymbolType) *SymbolStats

type ReelsStats

type ReelsStats struct {
	Reels   []*ReelStats
	Symbols []SymbolType
}

func BuildReelsStats

func BuildReelsStats(reels *sgc7game.ReelsData) (*ReelsStats, error)

func (*ReelsStats) GetNum

func (rss *ReelsStats) GetNum(reelindex int, symbol SymbolType, symbol2 SymbolType,
	wilds []SymbolType, irstype InReelSymbolType) int

func (*ReelsStats) GetReelLength

func (rss *ReelsStats) GetReelLength(reelindex int) int

func (*ReelsStats) GetReelLengthNoSymbol

func (rss *ReelsStats) GetReelLengthNoSymbol(reelindex int, symbol SymbolType, wilds []SymbolType) int

func (*ReelsStats) GetSymbolNum

func (rss *ReelsStats) GetSymbolNum(reelindex int, symbol SymbolType, wilds []SymbolType) int

func (*ReelsStats) GetSymbolNumNoWild

func (rss *ReelsStats) GetSymbolNumNoWild(reelindex int, symbol SymbolType, wilds []SymbolType) int

func (*ReelsStats) HasSymbols

func (rss *ReelsStats) HasSymbols(symbol SymbolType) bool

func (*ReelsStats) SaveExcel

func (rss *ReelsStats) SaveExcel(fn string) error

type SymbolStats

type SymbolStats struct {
	Symbol SymbolType
	Num    int
}

type SymbolType

type SymbolType int

type SymbolWinsStats

type SymbolWinsStats struct {
	Symbol  SymbolType
	WinsNum []int64
	Wins    []int64
}

type SymbolsWinsFileMode

type SymbolsWinsFileMode int
const (
	SWFModeRTP     SymbolsWinsFileMode = 1
	SWFModeWinsNum SymbolsWinsFileMode = 2
	SWFModeWins    SymbolsWinsFileMode = 3
)

type SymbolsWinsStats

type SymbolsWinsStats struct {
	MapSymbols map[SymbolType]*SymbolWinsStats
	Symbols    []SymbolType
	Num        int
	Total      int64
}

func AnalyzeReelsWithLine

func AnalyzeReelsWithLine(paytables *sgc7game.PayTables, reels *sgc7game.ReelsData,
	symbols []SymbolType, wilds []SymbolType, betMul int, lineNum int) (*SymbolsWinsStats, error)

func NewSymbolsWinsStats

func NewSymbolsWinsStats(num int) *SymbolsWinsStats

func (*SymbolsWinsStats) GetSymbolWinsStats

func (ssws *SymbolsWinsStats) GetSymbolWinsStats(symbol SymbolType) *SymbolWinsStats

func (*SymbolsWinsStats) SaveExcel

func (ssws *SymbolsWinsStats) SaveExcel(fn string, fm SymbolsWinsFileMode) error

Jump to

Keyboard shortcuts

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