View Single Post
Old 12-06-2012, 12:13 AM   PM User | #9
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,579
Thanks: 62
Thanked 4,064 Times in 4,033 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
But if this truly is a roulette simulation, then you need to *ALSO* determine what the PAYOFF is for win. That is, if the ball really is found in one of your arrays, what does the player get paid?

So I think you need to account for *ALL* of that.

I think (not sure) that this is pretty easy: I think that in roulette the payoff is always based on the number of choices available on the "bet" the user made.

That is, the payoff for the ball being in [1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34] is 3 for 1 because there are 12 elements to that array and 36/12 is 3.

Similarly, for a match on [0, 1] the payoff is 18 for 1, because there are 2 elements in that array and 36/2 is 18.

No?

As for generating ALL the possible splits: First of all, you only need the splits that one or more players have actually bet on. So I'd be tempted to use JS code to *generate* only those bet-on splits. For other bets (red, black, column, 6-group, etc.) I'd probably create the groups ahead of time.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote