slot

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoWay      = errors.New("no way to here")
	ErrBetEmpty   = errors.New("bet is empty")
	ErrNoLineset  = errors.New("lines set is empty")
	ErrLinesetOut = errors.New("lines set is out of range bet lines")
	ErrNoFeature  = errors.New("feature not available")
	ErrDisabled   = errors.New("feature is disabled")
)
View Source
var BetLinesAgt3x3 = [...]Linex{
	{2, 2, 2},
	{1, 1, 1},
	{3, 3, 3},
	{2, 1, 2},
	{2, 3, 2},
	{2, 1, 1},
	{2, 3, 3},
	{2, 2, 1},
	{3, 2, 2},
	{2, 1, 3},
	{2, 3, 1},
	{1, 2, 1},
	{3, 2, 3},
	{1, 2, 3},
	{3, 2, 1},
	{1, 1, 3},
	{3, 3, 1},
	{1, 3, 1},
	{3, 1, 3},
	{1, 1, 2},
	{3, 3, 2},
	{1, 3, 2},
	{3, 1, 2},
	{1, 3, 3},
	{3, 1, 1},
	{1, 2, 2},
	{2, 2, 3},
}

AGT software 3x3 slots bet lines

View Source
var BetLinesAgt4x4 = [...]Linex{
	{2, 2, 2, 2},
	{1, 1, 1, 1},
	{3, 3, 3, 3},
	{4, 4, 4, 4},
	{1, 2, 3, 4},
	{4, 3, 2, 1},
	{1, 2, 2, 1},
	{4, 3, 3, 4},
	{2, 1, 1, 2},
	{3, 4, 4, 3},
}

AGT software 4x4 slots bet lines

View Source
var BetLinesAgt5x3 = [...]Linex{
	{2, 2, 2, 2, 2},
	{1, 1, 1, 1, 1},
	{3, 3, 3, 3, 3},
	{1, 2, 3, 2, 1},
	{3, 2, 1, 2, 3},
	{1, 1, 2, 3, 3},
	{3, 3, 2, 1, 1},
	{2, 3, 3, 3, 2},
	{2, 1, 1, 1, 2},
	{1, 2, 2, 2, 1},
	{3, 2, 2, 2, 3},
	{2, 3, 2, 1, 2},
	{2, 1, 2, 3, 2},
	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ines

View Source
var BetLinesHot3 = []Linex{
	{2, 2, 2},
	{1, 1, 1},
	{3, 3, 3},
	{1, 2, 3},
	{3, 2, 1},
}

Ultra Hot 3x3 slot bet lines

View Source
var BetLinesHot5 = []Linex{
	{2, 2, 2, 2, 2},
	{1, 1, 1, 1, 1},
	{3, 3, 3, 3, 3},
	{1, 2, 3, 2, 1},
	{3, 2, 1, 2, 3},
}

Sizzling Hot bet lines

View Source
var BetLinesMgj = []Linex{
	{2, 2, 2, 2, 2},
	{1, 1, 1, 1, 1},
	{3, 3, 3, 3, 3},
	{1, 2, 3, 2, 1},
	{3, 2, 1, 2, 3},
	{1, 1, 2, 3, 3},
	{3, 3, 2, 1, 1},
	{2, 1, 2, 3, 2},
	{2, 3, 2, 1, 2},
	{1, 2, 1, 2, 1},
	{3, 2, 3, 2, 3},
	{1, 2, 2, 2, 2},
	{3, 2, 2, 2, 2},
	{2, 2, 1, 1, 1},
	{2, 2, 3, 3, 3},
	{2, 1, 1, 1, 1},
	{2, 3, 3, 3, 3},
	{1, 1, 1, 1, 2},
	{3, 3, 3, 3, 2},
	{3, 3, 2, 3, 3},
	{1, 1, 2, 1, 1},
}

Megajack 5x3 slots bet lines

View Source
var BetLinesNetEnt5x3 = [...]Linex{
	{2, 2, 2, 2, 2},
	{1, 1, 1, 1, 1},
	{3, 3, 3, 3, 3},
	{1, 2, 3, 2, 1},
	{3, 2, 1, 2, 3},
	{1, 1, 2, 1, 1},
	{3, 3, 2, 3, 3},
	{2, 3, 3, 3, 2},
	{2, 1, 1, 1, 2},
	{2, 1, 2, 1, 2},
	{2, 3, 2, 3, 2},
	{1, 2, 1, 2, 1},
	{3, 2, 3, 2, 3},
	{2, 2, 1, 2, 2},
	{2, 2, 3, 2, 2},
	{1, 2, 2, 2, 1},
	{3, 2, 2, 2, 3},
	{1, 2, 3, 3, 3},
	{3, 2, 1, 1, 1},
	{1, 3, 1, 3, 1},
	{3, 1, 3, 1, 3},
	{1, 3, 3, 3, 1},
	{3, 1, 1, 1, 3},
	{1, 1, 3, 1, 1},
	{3, 3, 1, 3, 3},
	{1, 3, 2, 1, 3},
	{3, 1, 2, 3, 1},
	{2, 1, 3, 2, 3},
	{1, 3, 2, 3, 2},
	{3, 2, 1, 1, 2},
}

NetEnt/BetSoft 5x3 slots bet lines

View Source
var BetLinesNetEnt5x4 = [...]Linex{
	{2, 2, 2, 2, 2},
	{3, 3, 3, 3, 3},
	{1, 1, 1, 1, 1},
	{4, 4, 4, 4, 4},
	{2, 3, 4, 3, 2},
	{3, 2, 1, 2, 3},
	{1, 1, 2, 3, 4},
	{4, 4, 3, 2, 1},
	{2, 1, 1, 1, 2},
	{3, 4, 4, 4, 3},
	{1, 2, 3, 4, 4},
	{4, 3, 2, 1, 1},
	{2, 1, 2, 3, 2},
	{3, 4, 3, 2, 3},
	{1, 2, 1, 2, 1},
	{4, 3, 4, 3, 4},
	{2, 3, 2, 1, 2},
	{3, 2, 3, 4, 3},
	{1, 2, 2, 2, 1},
	{4, 3, 3, 3, 4},
	{2, 2, 3, 4, 4},
	{3, 3, 2, 1, 1},
	{2, 2, 1, 2, 2},
	{3, 3, 4, 3, 3},
	{2, 3, 3, 3, 4},
	{3, 2, 2, 2, 1},
	{1, 1, 2, 1, 1},
	{4, 4, 3, 4, 4},
	{1, 2, 3, 3, 4},
	{4, 3, 2, 2, 1},
	{1, 1, 1, 2, 3},
	{4, 4, 4, 3, 2},
	{2, 1, 1, 2, 3},
	{3, 4, 4, 3, 2},
	{1, 2, 2, 3, 4},
	{4, 3, 3, 2, 1},
	{2, 1, 2, 3, 4},
	{3, 4, 3, 2, 1},
	{1, 2, 3, 4, 3},
	{4, 3, 2, 1, 2},
}

NetEnt 5x4 slots bet lines

View Source
var BetLinesNvm10 = []Linex{
	{2, 2, 2, 2, 2},
	{1, 1, 1, 1, 1},
	{3, 3, 3, 3, 3},
	{1, 2, 3, 2, 1},
	{3, 2, 1, 2, 3},
	{2, 3, 3, 3, 2},
	{2, 1, 1, 1, 2},
	{3, 3, 2, 1, 1},
	{1, 1, 2, 3, 3},
	{3, 2, 2, 2, 1},
}

Novomatic 5x3 slots bet lines (deluxe versions of games)

View Source
var BetLinesNvm20 = []Linex{
	{2, 2, 2, 2, 2},
	{1, 1, 1, 1, 1},
	{3, 3, 3, 3, 3},
	{1, 2, 3, 2, 1},
	{3, 2, 1, 2, 3},
	{1, 1, 2, 3, 3},
	{3, 3, 2, 1, 1},
	{2, 1, 1, 1, 2},
	{2, 3, 3, 3, 2},
	{1, 2, 2, 2, 1},
	{3, 2, 2, 2, 3},
	{2, 1, 2, 3, 2},
	{2, 3, 2, 1, 2},
	{1, 3, 1, 3, 1},
	{3, 1, 3, 1, 3},
	{1, 2, 1, 2, 1},
	{3, 2, 3, 2, 3},
	{1, 3, 3, 3, 3},
	{3, 1, 1, 1, 1},
	{2, 2, 1, 2, 2},
}

Novomatic 5x3 slots bet 20 lines (new games)

View Source
var BetLinesNvm25 = []Linex{
	{2, 2, 2, 2, 2},
	{1, 1, 1, 1, 1},
	{3, 3, 3, 3, 3},
	{1, 2, 3, 2, 1},
	{3, 2, 1, 2, 3},
	{2, 3, 3, 3, 2},
	{2, 1, 1, 1, 2},
	{3, 3, 2, 1, 1},
	{1, 1, 2, 3, 3},
	{3, 2, 2, 2, 1},
	{1, 2, 2, 2, 3},
	{2, 3, 2, 1, 2},
	{2, 1, 2, 3, 2},
	{1, 2, 1, 2, 1},
	{3, 2, 3, 2, 3},
	{2, 2, 1, 2, 2},
	{2, 2, 3, 2, 2},
	{1, 3, 1, 3, 1},
	{3, 1, 3, 1, 3},
	{3, 1, 2, 1, 3},
	{1, 3, 2, 3, 1},
	{1, 1, 3, 1, 1},
	{3, 3, 1, 3, 3},
	{2, 1, 3, 1, 2},
	{2, 3, 1, 3, 2},
}

Novomatic 5x3 slots bet 25 lines (new games)

View Source
var BetLinesNvm5x4 = [...]Linex{
	{1, 1, 1, 1, 1},
	{2, 2, 2, 2, 2},
	{3, 3, 3, 3, 3},
	{4, 4, 4, 4, 4},
	{1, 2, 3, 2, 1},
	{2, 3, 4, 3, 2},
	{3, 2, 1, 2, 3},
	{4, 3, 2, 3, 4},
	{1, 1, 1, 1, 2},
	{2, 2, 2, 2, 1},
	{3, 3, 3, 3, 4},
	{4, 4, 4, 4, 3},
	{1, 2, 2, 2, 2},
	{2, 2, 2, 2, 3},
	{3, 3, 3, 3, 2},
	{4, 3, 3, 3, 3},
	{2, 1, 1, 1, 1},
	{2, 3, 3, 3, 3},
	{3, 2, 2, 2, 2},
	{3, 4, 4, 4, 4},
	{1, 1, 1, 2, 3},
	{2, 2, 2, 3, 4},
	{3, 3, 3, 2, 1},
	{4, 4, 4, 3, 2},
	{1, 2, 3, 3, 3},
	{2, 3, 4, 4, 4},
	{3, 2, 1, 1, 1},
	{4, 3, 2, 2, 2},
	{1, 1, 2, 1, 1},
	{2, 2, 1, 2, 2},
	{3, 3, 4, 3, 3},
	{4, 4, 3, 4, 4},
	{1, 2, 2, 2, 1},
	{2, 2, 3, 2, 2},
	{3, 3, 2, 3, 3},
	{4, 3, 3, 3, 4},
	{2, 1, 1, 1, 2},
	{2, 3, 3, 3, 2},
	{3, 2, 2, 2, 3},
	{3, 4, 4, 4, 3},
}

Novomatic 5x4 slots bet lines

View Source
var BetLinesNvm9 = []Linex{
	{2, 2, 2, 2, 2},
	{1, 1, 1, 1, 1},
	{3, 3, 3, 3, 3},
	{1, 2, 3, 2, 1},
	{3, 2, 1, 2, 3},
	{2, 3, 3, 3, 2},
	{2, 1, 1, 1, 2},
	{3, 3, 2, 1, 1},
	{1, 1, 2, 3, 3},
}

Novomatic 5x3 slots bet lines (old versions of games)

View Source
var BetLinesPlt5x3 = [...]Linex{
	{2, 2, 2, 2, 2},
	{1, 1, 1, 1, 1},
	{3, 3, 3, 3, 3},
	{1, 2, 3, 2, 1},
	{3, 2, 1, 2, 3},
	{2, 1, 1, 1, 2},
	{2, 3, 3, 3, 2},
	{1, 1, 2, 3, 3},
	{3, 3, 2, 1, 1},
	{2, 3, 2, 1, 2},
	{2, 1, 2, 3, 2},
	{1, 2, 2, 2, 1},
	{3, 2, 2, 2, 3},
	{1, 2, 1, 2, 1},
	{3, 2, 3, 2, 3},
	{2, 2, 1, 2, 2},
	{2, 2, 3, 2, 2},
	{1, 1, 3, 1, 1},
	{3, 3, 1, 3, 3},
	{1, 3, 3, 3, 1},
	{3, 1, 1, 1, 3},
	{2, 3, 1, 3, 2},
	{2, 1, 3, 1, 2},
	{1, 3, 1, 3, 1},
	{3, 1, 3, 1, 3},
	{1, 3, 2, 1, 3},
	{3, 1, 2, 3, 1},
	{2, 1, 3, 2, 3},
	{1, 3, 2, 3, 1},
	{3, 2, 1, 1, 2},
}

Playtech 5x3 slots bet lines

Functions

func BruteForce3x

func BruteForce3x(ctx context.Context, s Stater, g SlotGame, reels *Reels3x)

func BruteForce3xGo added in v0.5.0

func BruteForce3xGo(ctx context.Context, s Stater, g SlotGame, reels *Reels3x)

func BruteForce4x added in v0.7.0

func BruteForce4x(ctx context.Context, s Stater, g SlotGame, reels *Reels4x)

func BruteForce4xGo added in v0.7.0

func BruteForce4xGo(ctx context.Context, s Stater, g SlotGame, reels *Reels4x)

func BruteForce5x

func BruteForce5x(ctx context.Context, s Stater, g SlotGame, reels *Reels5x)

func BruteForce5xGo

func BruteForce5xGo(ctx context.Context, s Stater, g SlotGame, reels *Reels5x)

func BruteForce6x added in v0.8.0

func BruteForce6x(ctx context.Context, s Stater, g SlotGame, reels *Reels6x)

func BruteForce6xGo added in v0.8.0

func BruteForce6xGo(ctx context.Context, s Stater, g SlotGame, reels *Reels6x)

func FindReels

func FindReels[T any](reelsmap map[float64]T, mrtp float64) (reels T, rtp float64)

func LoadMap added in v0.7.0

func LoadMap[T any](fpath string) (rm map[float64]T)

func LoadObj added in v0.7.0

func LoadObj[T any](fpath string) (obj T)

func MonteCarlo

func MonteCarlo(ctx context.Context, s Stater, g SlotGame, reels Reels)
func MonteCarloGo(ctx context.Context, s Stater, g SlotGame, reels Reels)

func ReadMap added in v0.7.0

func ReadMap[T any](b []byte) (rm map[float64]T)

func ReadObj added in v0.7.0

func ReadObj[T any](b []byte) (obj T)

func ScanReels3x added in v0.5.0

func ScanReels3x(ctx context.Context, s Stater, g SlotGame, reels *Reels3x,
	bftick, mctick <-chan time.Time) time.Duration

func ScanReels4x added in v0.7.0

func ScanReels4x(ctx context.Context, s Stater, g SlotGame, reels *Reels4x,
	bftick, mctick <-chan time.Time) time.Duration

func ScanReels5x added in v0.5.0

func ScanReels5x(ctx context.Context, s Stater, g SlotGame, reels *Reels5x,
	bftick, mctick <-chan time.Time) time.Duration

Types

type Linex

type Linex [8]Pos

func (*Linex) At

func (l *Linex) At(x Pos) Pos

func (*Linex) Copy

func (l *Linex) Copy(pos, num Pos) (dst Linex)

func (*Linex) CopyL

func (l *Linex) CopyL(num Pos) (dst Linex)

func (*Linex) CopyR5

func (l *Linex) CopyR5(num Pos) (dst Linex)

func (*Linex) Cover

func (l *Linex) Cover(op Linex) *Linex

func (*Linex) Len

func (l *Linex) Len() int

func (Linex) MarshalJSON

func (l Linex) MarshalJSON() ([]byte, error)

func (*Linex) Set

func (l *Linex) Set(x Pos, val Pos)

type Pos

type Pos int8 // screen or line position

type Reels

type Reels interface {
	Cols() int          // returns number of columns
	Reel(col Pos) []Sym // returns reel at given column, index from
	Reshuffles() uint64 // returns total number of reshuffles
}

type Reels3x

type Reels3x [3][]Sym

Reels for 3-reels slots.

func (*Reels3x) Cols

func (r *Reels3x) Cols() int

func (*Reels3x) Reel

func (r *Reels3x) Reel(col Pos) []Sym

func (*Reels3x) Reshuffles

func (r *Reels3x) Reshuffles() uint64

type Reels4x added in v0.7.0

type Reels4x [4][]Sym

Reels for 4-reels slots.

func (*Reels4x) Cols added in v0.7.0

func (r *Reels4x) Cols() int

func (*Reels4x) Reel added in v0.7.0

func (r *Reels4x) Reel(col Pos) []Sym

func (*Reels4x) Reshuffles added in v0.7.0

func (r *Reels4x) Reshuffles() uint64

type Reels5x

type Reels5x [5][]Sym

Reels for 5-reels slots.

func (*Reels5x) Cols

func (r *Reels5x) Cols() int

func (*Reels5x) Reel

func (r *Reels5x) Reel(col Pos) []Sym

func (*Reels5x) Reshuffles

func (r *Reels5x) Reshuffles() uint64

type Reels6x added in v0.8.0

type Reels6x [6][]Sym

Reels for 6-reels slots.

func (*Reels6x) Cols added in v0.8.0

func (r *Reels6x) Cols() int

func (*Reels6x) Reel added in v0.8.0

func (r *Reels6x) Reel(col Pos) []Sym

func (*Reels6x) Reshuffles added in v0.8.0

func (r *Reels6x) Reshuffles() uint64

type Screen

type Screen interface {
	Dim() (Pos, Pos)                   // returns screen dimensions
	At(x, y Pos) Sym                   // returns symbol at position (x, y), starts from (1, 1)
	Pos(x Pos, line Linex) Sym         // returns symbol at position (x, line(x)), starts from (1, 1)
	Set(x, y Pos, sym Sym)             // setup symbol at given position
	SetCol(x Pos, reel []Sym, pos int) // setup column on screen with given reel at given position
	Spin(reels Reels)                  // fill the screen with random hits on those reels
	SymNum(sym Sym) (n Pos)            // returns number of symbols on the screen that can repeats on reel
	ScatNum(scat Sym) (n Pos)          // returns number of scatters on the screen
	ScatPos(scat Sym) Linex            // returns line with scatters positions on the screen
}

Screen contains symbols rectangle of the slot game. It can be with dimensions 3x1, 3x3, 4x4, 5x3, 5x4 or others. (1 ,1) symbol is on left top corner.

type Screen3x3

type Screen3x3 [3][3]Sym

Screen for 3x3 slots.

func (*Screen3x3) At

func (s *Screen3x3) At(x, y Pos) Sym

func (*Screen3x3) Dim

func (s *Screen3x3) Dim() (Pos, Pos)

func (*Screen3x3) Pos

func (s *Screen3x3) Pos(x Pos, line Linex) Sym

func (*Screen3x3) ScatNum

func (s *Screen3x3) ScatNum(scat Sym) (n Pos)

func (*Screen3x3) ScatPos

func (s *Screen3x3) ScatPos(scat Sym) (l Linex)

func (*Screen3x3) Set

func (s *Screen3x3) Set(x, y Pos, sym Sym)

func (*Screen3x3) SetCol

func (s *Screen3x3) SetCol(x Pos, reel []Sym, pos int)

func (*Screen3x3) Spin

func (s *Screen3x3) Spin(reels Reels)

func (*Screen3x3) SymNum added in v0.6.0

func (s *Screen3x3) SymNum(sym Sym) (n Pos)

type Screen4x4 added in v0.7.0

type Screen4x4 [4][4]Sym

Screen for 4x4 slots.

func (*Screen4x4) At added in v0.7.0

func (s *Screen4x4) At(x, y Pos) Sym

func (*Screen4x4) Dim added in v0.7.0

func (s *Screen4x4) Dim() (Pos, Pos)

func (*Screen4x4) Pos added in v0.7.0

func (s *Screen4x4) Pos(x Pos, line Linex) Sym

func (*Screen4x4) ScatNum added in v0.7.0

func (s *Screen4x4) ScatNum(scat Sym) (n Pos)

func (*Screen4x4) ScatPos added in v0.7.0

func (s *Screen4x4) ScatPos(scat Sym) (l Linex)

func (*Screen4x4) Set added in v0.7.0

func (s *Screen4x4) Set(x, y Pos, sym Sym)

func (*Screen4x4) SetCol added in v0.7.0

func (s *Screen4x4) SetCol(x Pos, reel []Sym, pos int)

func (*Screen4x4) Spin added in v0.7.0

func (s *Screen4x4) Spin(reels Reels)

func (*Screen4x4) SymNum added in v0.7.0

func (s *Screen4x4) SymNum(sym Sym) (n Pos)

type Screen5x3

type Screen5x3 [5][3]Sym

Screen for 5x3 slots.

func (*Screen5x3) At

func (s *Screen5x3) At(x, y Pos) Sym

func (*Screen5x3) Dim

func (s *Screen5x3) Dim() (Pos, Pos)

func (*Screen5x3) Pos

func (s *Screen5x3) Pos(x Pos, line Linex) Sym

func (*Screen5x3) ScatNum

func (s *Screen5x3) ScatNum(scat Sym) (n Pos)

func (*Screen5x3) ScatPos

func (s *Screen5x3) ScatPos(scat Sym) (l Linex)

func (*Screen5x3) Set

func (s *Screen5x3) Set(x, y Pos, sym Sym)

func (*Screen5x3) SetCol

func (s *Screen5x3) SetCol(x Pos, reel []Sym, pos int)

func (*Screen5x3) Spin

func (s *Screen5x3) Spin(reels Reels)

func (*Screen5x3) SymNum added in v0.6.0

func (s *Screen5x3) SymNum(sym Sym) (n Pos)

type Screen5x4

type Screen5x4 [5][4]Sym

Screen for 5x4 slots.

func (*Screen5x4) At

func (s *Screen5x4) At(x, y Pos) Sym

func (*Screen5x4) Dim

func (s *Screen5x4) Dim() (Pos, Pos)

func (*Screen5x4) Pos

func (s *Screen5x4) Pos(x Pos, line Linex) Sym

func (*Screen5x4) ScatNum

func (s *Screen5x4) ScatNum(scat Sym) (n Pos)

func (*Screen5x4) ScatPos

func (s *Screen5x4) ScatPos(scat Sym) (l Linex)

func (*Screen5x4) Set

func (s *Screen5x4) Set(x, y Pos, sym Sym)

func (*Screen5x4) SetCol

func (s *Screen5x4) SetCol(x Pos, reel []Sym, pos int)

func (*Screen5x4) Spin

func (s *Screen5x4) Spin(reels Reels)

func (*Screen5x4) SymNum added in v0.6.0

func (s *Screen5x4) SymNum(sym Sym) (n Pos)

type Screen6x3 added in v0.8.0

type Screen6x3 [6][3]Sym

Screen for 6x3 slots.

func (*Screen6x3) At added in v0.8.0

func (s *Screen6x3) At(x, y Pos) Sym

func (*Screen6x3) Dim added in v0.8.0

func (s *Screen6x3) Dim() (Pos, Pos)

func (*Screen6x3) Pos added in v0.8.0

func (s *Screen6x3) Pos(x Pos, line Linex) Sym

func (*Screen6x3) ScatNum added in v0.8.0

func (s *Screen6x3) ScatNum(scat Sym) (n Pos)

func (*Screen6x3) ScatPos added in v0.8.0

func (s *Screen6x3) ScatPos(scat Sym) (l Linex)

func (*Screen6x3) Set added in v0.8.0

func (s *Screen6x3) Set(x, y Pos, sym Sym)

func (*Screen6x3) SetCol added in v0.8.0

func (s *Screen6x3) SetCol(x Pos, reel []Sym, pos int)

func (*Screen6x3) Spin added in v0.8.0

func (s *Screen6x3) Spin(reels Reels)

func (*Screen6x3) SymNum added in v0.8.0

func (s *Screen6x3) SymNum(sym Sym) (n Pos)

type Screen6x4 added in v0.8.0

type Screen6x4 [6][4]Sym

Screen for 6x4 slots.

func (*Screen6x4) At added in v0.8.0

func (s *Screen6x4) At(x, y Pos) Sym

func (*Screen6x4) Dim added in v0.8.0

func (s *Screen6x4) Dim() (Pos, Pos)

func (*Screen6x4) Pos added in v0.8.0

func (s *Screen6x4) Pos(x Pos, line Linex) Sym

func (*Screen6x4) ScatNum added in v0.8.0

func (s *Screen6x4) ScatNum(scat Sym) (n Pos)

func (*Screen6x4) ScatPos added in v0.8.0

func (s *Screen6x4) ScatPos(scat Sym) (l Linex)

func (*Screen6x4) Set added in v0.8.0

func (s *Screen6x4) Set(x, y Pos, sym Sym)

func (*Screen6x4) SetCol added in v0.8.0

func (s *Screen6x4) SetCol(x Pos, reel []Sym, pos int)

func (*Screen6x4) Spin added in v0.8.0

func (s *Screen6x4) Spin(reels Reels)

func (*Screen6x4) SymNum added in v0.8.0

func (s *Screen6x4) SymNum(sym Sym) (n Pos)

type Screenx

type Screenx struct {
	// contains filtered or unexported fields
}

func (*Screenx) At

func (s *Screenx) At(x, y Pos) Sym

func (*Screenx) Dim

func (s *Screenx) Dim() (Pos, Pos)

func (*Screenx) Init added in v0.8.0

func (s *Screenx) Init(sx, sy Pos)

func (*Screenx) Len

func (s *Screenx) Len() int

func (*Screenx) MarshalJSON

func (s *Screenx) MarshalJSON() ([]byte, error)

func (*Screenx) Pos

func (s *Screenx) Pos(x Pos, line Linex) Sym

func (*Screenx) ScatNum

func (s *Screenx) ScatNum(scat Sym) (n Pos)

func (*Screenx) ScatPos

func (s *Screenx) ScatPos(scat Sym) (l Linex)

func (*Screenx) Set

func (s *Screenx) Set(x, y Pos, sym Sym)

func (*Screenx) SetCol

func (s *Screenx) SetCol(x Pos, reel []Sym, pos int)

func (*Screenx) Spin

func (s *Screenx) Spin(reels Reels)

func (*Screenx) SymNum added in v0.6.0

func (s *Screenx) SymNum(sym Sym) (n Pos)

func (*Screenx) UnmarshalJSON

func (s *Screenx) UnmarshalJSON(b []byte) (err error)

func (*Screenx) UpdateDim

func (s *Screenx) UpdateDim() (sx, sy Pos)

type SlotGame

type SlotGame interface {
	Clone() SlotGame       // returns full cloned copy of itself
	Screen() Screen        // returns screen object for this game, constat function
	Scanner(*Wins)         // scan given screen and append result to wins, constat function
	Spin(float64)          // fill the screen with random hits on reels closest to given RTP, constat function
	Spawn(Wins)            // setup bonus games to wins results, constat function
	Prepare()              // update game state before new spin
	Apply(Wins)            // update game state to spin results
	FreeSpins() bool       // returns if it free spins mode, constat function
	GetGain() float64      // returns gain for double up games, constat function
	SetGain(float64) error // set gain to given value on double up games
	GetBet() float64       // returns current bet, constat function
	SetBet(float64) error  // set bet to given value
	GetSel() int           // returns number of selected bet lines, constat function
	SetSel(int) error      // setup number of selected bet lines
	SetMode(int) error     // change game mode depending on the user's choice
}

SlotGame is common slots interface. Any slot game should implement this interface.

type Slotx added in v0.8.0

type Slotx[T any] struct {
	Scr T       `json:"scr" yaml:"scr" xml:"scr"` // game screen
	Sel int     `json:"sel" yaml:"sel" xml:"sel"` // selected bet lines
	Bet float64 `json:"bet" yaml:"bet" xml:"bet"` // bet value

	// gain for double up games
	Gain float64 `json:"gain,omitempty" yaml:"gain,omitempty" xml:"gain,omitempty"`
	// free spin number
	FSN int `json:"fsn,omitempty" yaml:"fsn,omitempty" xml:"fsn,omitempty"`
	// free spin remains
	FSR int `json:"fsr,omitempty" yaml:"fsr,omitempty" xml:"fsr,omitempty"`
}

Slotx is base struct for all slot games with subsequent screen.

func (*Slotx[T]) Apply added in v0.8.0

func (g *Slotx[T]) Apply(wins Wins)

func (*Slotx[T]) FreeSpins added in v0.8.0

func (g *Slotx[T]) FreeSpins() bool

func (*Slotx[T]) GetBet added in v0.8.0

func (g *Slotx[T]) GetBet() float64

func (*Slotx[T]) GetGain added in v0.8.0

func (g *Slotx[T]) GetGain() float64

func (*Slotx[T]) GetSel added in v0.8.0

func (g *Slotx[T]) GetSel() int

func (*Slotx[T]) Prepare added in v0.8.0

func (g *Slotx[T]) Prepare()

func (*Slotx[T]) Screen added in v0.8.0

func (g *Slotx[T]) Screen() Screen

func (*Slotx[T]) SetBet added in v0.8.0

func (g *Slotx[T]) SetBet(bet float64) error

func (*Slotx[T]) SetGain added in v0.8.0

func (g *Slotx[T]) SetGain(gain float64) error

func (*Slotx[T]) SetMode added in v0.8.0

func (g *Slotx[T]) SetMode(int) error

func (*Slotx[T]) SetSelNum added in v0.8.0

func (g *Slotx[T]) SetSelNum(sel int, bln int) error

func (*Slotx[T]) Spawn added in v0.8.0

func (g *Slotx[T]) Spawn(wins Wins)

type Stat

type Stat struct {
	Reshuffles uint64
	LinePay    float64
	ScatPay    float64
	FreeCount  uint64
	FreeHits   uint64
	BonusCount [8]uint64
	JackCount  [4]uint64
	LPM, SPM   sync.Mutex
	// contains filtered or unexported fields
}

Stat is statistics calculation for slot reels.

func (*Stat) Count

func (s *Stat) Count() uint64

func (*Stat) Planned

func (s *Stat) Planned() uint64

func (*Stat) Progress

func (s *Stat) Progress(ctx context.Context, steps <-chan time.Time, sel int, total float64)

func (*Stat) SetPlan

func (s *Stat) SetPlan(n uint64)

func (*Stat) Update

func (s *Stat) Update(wins Wins)

type Stater

type Stater interface {
	SetPlan(n uint64)
	Planned() uint64
	Count() uint64
	Update(wins Wins)
	Progress(ctx context.Context, steps <-chan time.Time, sel int, total float64)
}

type Sym

type Sym byte // symbol type

type WinItem

type WinItem struct {
	Pay  float64 `json:"pay,omitempty" yaml:"pay,omitempty" xml:"pay,omitempty,attr"`    // payment with selected bet
	Mult float64 `json:"mult,omitempty" yaml:"mult,omitempty" xml:"mult,omitempty,attr"` // multiplier of payment for free spins and other special cases
	Sym  Sym     `json:"sym,omitempty" yaml:"sym,omitempty" xml:"sym,omitempty,attr"`    // win symbol
	Num  Pos     `json:"num,omitempty" yaml:"num,omitempty" xml:"num,omitempty,attr"`    // number of win symbols
	Line int     `json:"line,omitempty" yaml:"line,omitempty" xml:"line,omitempty,attr"` // line mumber (0 for scatters and not lined combinations)
	XY   Linex   `json:"xy" yaml:"xy" xml:"xy"`                                          // symbols positions on screen
	Free int     `json:"free,omitempty" yaml:"free,omitempty" xml:"free,omitempty,attr"` // number of free spins
	BID  int     `json:"bid,omitempty" yaml:"bid,omitempty" xml:"bid,omitempty,attr"`    // bonus identifier
	Jack int     `json:"jack,omitempty" yaml:"jack,omitempty" xml:"jack,omitempty,attr"` // jackpot identifier
	Bon  any     `json:"bon,omitempty" yaml:"bon,omitempty" xml:"bon,omitempty"`         // bonus game data
}

WinItem describes win on each line or by scatters.

type Wins

type Wins []WinItem

Wins is full list of wins by all lines and scatters for some spin.

func (Wins) Gain

func (wins Wins) Gain() float64

Total gain for spin.

func (*Wins) Reset

func (wins *Wins) Reset()

Reset puts lines to pool and set array empty with saved capacity.

Jump to

Keyboard shortcuts

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