Thread: Problem array, if! View Single Post
12-06-2012, 02:57 PM   PM User | #10
triko
New Coder

Join Date: Oct 2012
Location: Italy
Posts: 72
Thanks: 3
Thanked 0 Times in 0 Posts
Quote:
 Originally Posted by Old Pedant 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? time.
Don't understand this part, but I know the value of various bet on, Example if number of ball is your bet on, the money that you put is multiplied for 35!
If you bet on red or black is multiplied for 2, if bet on columns is for 5!!!
I have structured my problem do it:
Code:
function start ()
{
var ball = Math.floor (Math.random ()*36);
// Write all var for Numbers
var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36];
// Write all var for Even bets
var red = [1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 19, 21, 23, 25, 27, 30, 32, 34, 36];
var black = [2, 4, 6, 8, 10, 11, 13, 15, 17, 20, 22, 24, 26, 28, 29, 31, 33, 35];
var odd = [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35];
var even [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36];
var manque = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18];
var passe = [19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35];
// Write all var for Dozens
var ereFirts = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
var ereSecond = [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24];
var ereThird = [25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35];
// Write all var for Columns
var col1 = [1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34];
var col2 = [2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35];
var col3 = [3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36];
// Write all var for Lines or Double Streets
var lin1 = [1, 2, 3, 4, 5, 6];
var lin2 = [4, 5, 6, 7, 8, 9];
var lin3 = [7, 8, 9, 10, 11, 12];
.........................
// Write all var for Corners
var cor1 = [0, 1, 2, 3];
var cor2 = [1, 2, 4, 5];
var cor3 = [2, 3, 5, 6];
var cor4 = [4, 5, 7, 8];
var cor5 = [5, 6, 8, 9];
.......................

// Write all var for Streets
var strt1 = [0, 1, 2];
var strt2 = [0, 2, 3];
var strt3 = [1, 2, 3];
var strt4 = [4, 5, 6];
var strt5 = [7, 8, 9];
var strt6 = [10, 11, 12];
......................
// Write all var for Split
var split1 = [0, 1];
var split2 = [0, 2];
var split3 = [0, 3];
var split4 = [1, 2];
var split5 = [2, 3];
var split6 = [1, 4];
var split7 = [2, 5];
var split8 = [3, 6];
var split9 = [4, 5];
var split10 = [5, 6];
//Now i don't know how to do for verify if the number of var ball is into that one of this ARRAY!
I use simple css with checkbox for rappresent all possibility, so You choose How much put into check and before check what do you want: columns, number single, spli, red, ecc.....!!!
}
It's complicate!! sad problem!!