-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4d3004
commit 7b855a7
Showing
12 changed files
with
458 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package panda | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"time" | ||
|
||
"github.com/slotopol/server/game/slot" | ||
) | ||
|
||
func CalcStat(ctx context.Context, mrtp float64) float64 { | ||
var reels, _ = slot.FindReels(ReelsMap, mrtp) | ||
var g = NewGame() | ||
var sln float64 = 1 | ||
g.Sel = int(sln) | ||
var s slot.Stat | ||
|
||
var dur = slot.ScanReels3x(ctx, &s, g, reels, | ||
time.Tick(2*time.Second), time.Tick(2*time.Second)) | ||
|
||
var reshuf = float64(s.Reshuffles) | ||
var lrtp, srtp = s.LinePay / reshuf / sln * 100, s.ScatPay / reshuf / sln * 100 | ||
var rtpsym = lrtp + srtp | ||
var q = float64(s.FreeCount) / reshuf | ||
var sq = 1 / (1 - q) | ||
var rtpfs = sq * rtpsym | ||
var rtp = rtpsym + q*rtpfs | ||
fmt.Printf("completed %.5g%%, selected %d lines, time spent %v\n", reshuf/float64(s.Planned())*100, g.Sel, dur) | ||
fmt.Printf("reels lengths [%d, %d, %d], total reshuffles %d\n", | ||
len(reels.Reel(1)), len(reels.Reel(2)), len(reels.Reel(3)), reels.Reshuffles()) | ||
fmt.Printf("symbols: %.5g(lined) + %.5g(scatter) = %.6f%%\n", lrtp, srtp, rtpsym) | ||
fmt.Printf("free spins %d, q = %.5g, sq = 1/(1-q) = %.6f\n", s.FreeCount, q, sq) | ||
fmt.Printf("free games frequency: 1/%.5g\n", reshuf/float64(s.FreeHits)) | ||
fmt.Printf("RTP = %.5g(sym) + %.5g*%.5g(fg) = %.6f%%\n", rtpsym, q, rtpfs, rtp) | ||
return rtp | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//go:build !prod || full || agt | ||
|
||
package panda | ||
|
||
import ( | ||
"github.com/slotopol/server/game" | ||
) | ||
|
||
var Info = game.GameInfo{ | ||
Aliases: []game.GameAlias{ | ||
{Prov: "AGT", Name: "Panda"}, | ||
}, | ||
GP: game.GPretrig | | ||
game.GPscat | | ||
game.GPwild, | ||
SX: 3, | ||
SY: 3, | ||
SN: len(LinePay), | ||
LN: len(BetLines), | ||
BN: 0, | ||
RTP: game.MakeRtpList(ReelsMap), | ||
} | ||
|
||
func init() { | ||
Info.SetupFactory(func() any { return NewGame() }, CalcStat) | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
package panda | ||
|
||
// See: https://demo.agtsoftware.com/games/agt/panda | ||
|
||
import ( | ||
"github.com/slotopol/server/game/slot" | ||
) | ||
|
||
// Lined payment. | ||
var LinePay = [9][3]float64{ | ||
{0, 0, 500}, // 1 wild | ||
{0, 0, 160}, // 2 bonsai | ||
{0, 0, 80}, // 3 fish | ||
{0, 0, 40}, // 4 fan | ||
{0, 0, 20}, // 5 lamp | ||
{0, 0, 20}, // 6 pot | ||
{0, 0, 20}, // 7 flower | ||
{0, 0, 10}, // 8 button | ||
{}, // 9 scatter | ||
} | ||
|
||
// Bet lines | ||
var BetLines = slot.BetLinesAgt3x3[:27] | ||
|
||
type Game struct { | ||
slot.Slot3x3 `yaml:",inline"` | ||
} | ||
|
||
// Declare conformity with SlotGame interface. | ||
var _ slot.SlotGame = (*Game)(nil) | ||
|
||
func NewGame() *Game { | ||
return &Game{ | ||
Slot3x3: slot.Slot3x3{ | ||
Sel: len(BetLines), | ||
Bet: 1, | ||
}, | ||
} | ||
} | ||
|
||
const wild, scat = 1, 9 | ||
|
||
func (g *Game) Scanner(screen slot.Screen, wins *slot.Wins) { | ||
for li := 1; li <= g.Sel; li++ { | ||
var line = BetLines[li-1] | ||
|
||
var numw, numl slot.Pos = 0, 3 | ||
var syml slot.Sym | ||
var x slot.Pos | ||
for x = 1; x <= 3; x++ { | ||
var sx = screen.Pos(x, line) | ||
if sx == wild { | ||
if syml == 0 { | ||
numw = x | ||
} | ||
} else if syml == 0 && sx != scat { | ||
syml = sx | ||
} else if sx != syml { | ||
numl = x - 1 | ||
break | ||
} | ||
} | ||
|
||
if numw == 3 { | ||
var pay = LinePay[wild-1][numw-1] | ||
*wins = append(*wins, slot.WinItem{ | ||
Pay: g.Bet * pay, | ||
Mult: 1, | ||
Sym: wild, | ||
Num: numw, | ||
Line: li, | ||
XY: line.CopyL(numw), | ||
}) | ||
} else if numl == 3 { | ||
var pay = LinePay[syml-1][numl-1] | ||
*wins = append(*wins, slot.WinItem{ | ||
Pay: g.Bet * pay, | ||
Mult: 1, | ||
Sym: syml, | ||
Num: numl, | ||
Line: li, | ||
XY: line.CopyL(numl), | ||
}) | ||
} | ||
} | ||
|
||
if count := screen.ScatNum(scat); count > 0 { | ||
*wins = append(*wins, slot.WinItem{ | ||
Sym: scat, | ||
Num: count, | ||
XY: screen.ScatPos(scat), | ||
Free: int(count), | ||
}) | ||
} | ||
} | ||
|
||
func (g *Game) Spin(screen slot.Screen, mrtp float64) { | ||
var reels, _ = slot.FindReels(ReelsMap, mrtp) | ||
screen.Spin(reels) | ||
} | ||
|
||
func (g *Game) SetSel(sel int) error { | ||
return slot.ErrNoFeature | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
local path = arg[0]:match("(.*[/\\])") | ||
dofile(path.."lib/reelgen.lua") | ||
|
||
local symset = { | ||
1, -- 1 wild | ||
3, -- 2 bonsai | ||
5, -- 3 fish | ||
5, -- 4 fan | ||
9, -- 5 lamp | ||
10, -- 6 pot | ||
10, -- 7 flower | ||
13, -- 8 button | ||
1, -- 9 scatter | ||
} | ||
|
||
local chunklen = { | ||
1, -- 1 wild | ||
3, -- 2 bonsai | ||
3, -- 3 fish | ||
3, -- 4 fan | ||
5, -- 5 lamp | ||
5, -- 6 pot | ||
5, -- 7 flower | ||
5, -- 8 button | ||
1, -- 9 scatter | ||
} | ||
|
||
math.randomseed(os.time()) | ||
local reel, iter = makereelhot(symset, 3, {}, chunklen, true) | ||
printreel(reel, iter) |