-
Notifications
You must be signed in to change notification settings - Fork 12
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
ac09b65
commit c2d3325
Showing
8 changed files
with
596 additions
and
4 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,68 @@ | ||
package infinitygems | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"time" | ||
|
||
"github.com/slotopol/server/game/slot" | ||
) | ||
|
||
func CalcStatBon(ctx context.Context) float64 { | ||
var reels = &ReelsBon | ||
var g = NewGame() | ||
var sln float64 = 1 | ||
g.Sel = int(sln) | ||
g.FS = 50 // set free spins mode | ||
var s slot.Stat | ||
|
||
var dur = slot.ScanReels5x(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 rtp = sq * rtpsym | ||
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, %d, %d], total reshuffles %d\n", | ||
len(reels.Reel(1)), len(reels.Reel(2)), len(reels.Reel(3)), len(reels.Reel(4)), len(reels.Reel(5)), 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 = sq*rtp(sym) = %.5g*%.5g = %.6f%%\n", sq, rtpsym, rtp) | ||
return rtp | ||
} | ||
|
||
func CalcStatReg(ctx context.Context, mrtp float64) float64 { | ||
fmt.Printf("*bonus reels calculations*\n") | ||
var rtpfs = CalcStatBon(ctx) | ||
if ctx.Err() != nil { | ||
return 0 | ||
} | ||
fmt.Printf("*regular reels calculations*\n") | ||
var reels, _ = slot.FindReels(ReelsMap, mrtp) | ||
var g = NewGame() | ||
var sln float64 = 1 | ||
g.Sel = int(sln) | ||
var s slot.Stat | ||
|
||
var dur = slot.ScanReels5x(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 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, %d, %d], total reshuffles %d\n", | ||
len(reels.Reel(1)), len(reels.Reel(2)), len(reels.Reel(3)), len(reels.Reel(4)), len(reels.Reel(5)), 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,34 @@ | ||
//go:build !prod || full || agt | ||
|
||
package infinitygems | ||
|
||
import ( | ||
"github.com/slotopol/server/game" | ||
"github.com/slotopol/server/util" | ||
) | ||
|
||
var Info = game.GameInfo{ | ||
Aliases: []game.GameAlias{ | ||
{Prov: "AGT", Name: "Infinity Gems"}, | ||
}, | ||
GP: game.GPsel | | ||
game.GPretrig | | ||
game.GPfgreel | | ||
game.GPscat | | ||
game.GPwild, | ||
SX: 5, | ||
SY: 3, | ||
SN: len(LinePay), | ||
LN: len(BetLines), | ||
BN: 0, | ||
RTP: game.MakeRtpList(ReelsMap), | ||
} | ||
|
||
func init() { | ||
game.GameList = append(game.GameList, &Info) | ||
for _, ga := range Info.Aliases { | ||
var aid = util.ToID(ga.Prov + "/" + ga.Name) | ||
game.ScanFactory[aid] = CalcStatReg | ||
game.GameFactory[aid] = func() any { return NewGame() } | ||
} | ||
} |
Oops, something went wrong.