de en es fr
Let the machine help
Light teasing, exhibition, BDSM, sissyfication, watersports... with sounds and pictures


Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
Author Message
 Wheel Of Discipline bug
PostPosted: Sat May 05, 2018 11:45 pm 
Offline
Regular
There is a bug in setWheelTotalSpins when wheelTotalSpinsRandom is true. You are more likely to get wheelTotalSpinsMin then any other value (unless min is 1). The chance of that happening goes up with larger values of wheelTotalSpinsMin.

Using the default min/max values of 2 & 6, you should get one of 2 3 4 5 6 depending on the random() result. But as is, you get one of : 2 2 3 4 5 6. If the min/max are 4 & 6, you get: 4 4 4 4 5 6

To fix, replace

wheelTotalSpins = getRandom(wheelTotalSpinsMax)+1 // gives 1..max
if(wheelTotalSpins<wheelTotalSpinsMin)
wheelTotalSpins = wheelTotalSpinsMin // maps all values < min to min

with

wheelTotalSpins = getRandom(wheelTotalSpinsMax - wheelTotalSpinsMin + 1) + wheelTotalSpinsMin


Top
 Profile Send private message 
 
 Re: Wheel Of Discipline bug
PostPosted: Sun May 06, 2018 9:02 am 
Offline
Veteran
User avatar
ralph333 wrote:
There is a bug in setWheelTotalSpins when wheelTotalSpinsRandom is true. You are more likely to get wheelTotalSpinsMin then any other value (unless min is 1). The chance of that happening goes up with larger values of wheelTotalSpinsMin.

Using the default min/max values of 2 & 6, you should get one of 2 3 4 5 6 depending on the random() result. But as is, you get one of : 2 2 3 4 5 6. If the min/max are 4 & 6, you get: 4 4 4 4 5 6

To fix, replace

wheelTotalSpins = getRandom(wheelTotalSpinsMax)+1 // gives 1..max
if(wheelTotalSpins<wheelTotalSpinsMin)
wheelTotalSpins = wheelTotalSpinsMin // maps all values < min to min

with

wheelTotalSpins = getRandom(wheelTotalSpinsMax - wheelTotalSpinsMin + 1) + wheelTotalSpinsMin

Thanks for spotting that and highlighting the fix. I will update tomorrow with this fixed! :)


Top
 Profile Send private message 
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Maroon Fusion theme created by Oxydo
Software, theme modifications, phpBB modification by Doti 2010, 2015
This website uses session cookies only.