Wednesday 15 April 2015

matrix - Creating unique rows from number of bets 1 X 2 on 8 games -


I'm trying to get rows from a 3x8 matrix (5651 unique lines). I could not do this because now I am trying to make rows.

Let's say that I have a total of 10 bets / games and distribution of the game looks like this:

  1 11111111 | XX | 0 2 111111 | X | 222 3 11 | XXXXXXXX | 0 4 1111 | XXX | 222 5 11 | XX | 222222 6 1111 | XXX | 222 7 0 | XXX | 2222222 8. | XXX | 2222222  

Each game in the code is an object in which there is 1, x, 2 integer, which holds the number of symbols.

1 8 2 0 2 6 1 3 3. 2 8 4 4 3 3 5. 2 2 6 6. 4 3 3 7. 0 3 7 8. 0 3 7 < / Code>

If, for example, I put the variable 8 together with a variable in this way:

  ArrayLeatGame 1: 11111111XX Arrest game 2: 111111 X 222 array Game 3: 11XXXXXXXX Arrielest Games 4: 1111XXX222 Arrest Game5: 11XX222222 Arrest Game 6: 1111XXX222 Arrest Game 7: XXX2222222 Arrest Game8: XXX2222222  

I have all the 1 to 8 array lists How can I get the combinations that are 10 unique lines Ends with?

The challenge is that I can not do it too big for the number / game quantity.

I think the code below may be useful:

 < Code> ArrayList & LT; String & gt; Arr = new ArrayList & lt; String & gt; (8); Int [] [] A = {{8, 2, 0}, ..., {0, 3, 7}}; Four [] c = {'1', 'x', '2'}; For (int i = 0; i & lt; a.length; ++ i) {string rays = ""; For (int j = 0; j & lt; 3; ++ j) for (int k = 0; k & lt; a [i] [j]; ++ k) res + = c [j]; Arr.set (i, res); }  

In other words, this method performs an arati through the array to create the output string and sets it in an array list.

Description of ArrayList:


No comments:

Post a Comment