J
Joosy
Hi
I am stumped on a complex combination problem. I need to create all possible
combinations to fill grids 7 columns wide with set parameter restrictions.
Parameters are: 1) the number of columns the grid will take 2) the number of
times 'x' is to appear in the columns, going downwards 3) the maximum number
of spaces before an 'x' 4) the minimum number of 'x' in a row 5) the maximum
number of x in a row.
For example BuildGrids(3,1,6,2,3) might produce
000000x - this row has six spaces
x00xxx0 - this row has three x
0xx0000 - this row has two xs
Each column contains one and only one 'x' the maximum number of spaces is 6,
the minimum number of times 'x' appears together is 2.
This should keep producing different combinations that fit the rules until
all possible combinations are exhausted.
In the variations produced, we don't need to achieve either the maximum or
minimum number of x in a row. It just need to fall within the parameters.
BuildGrid(4,2,4,1,6) might produce
00xx00x
xx00xxx
xxx0xx0
000x000
The combination of rows two and three produce six x in a row.
I am stumped on a complex combination problem. I need to create all possible
combinations to fill grids 7 columns wide with set parameter restrictions.
Parameters are: 1) the number of columns the grid will take 2) the number of
times 'x' is to appear in the columns, going downwards 3) the maximum number
of spaces before an 'x' 4) the minimum number of 'x' in a row 5) the maximum
number of x in a row.
For example BuildGrids(3,1,6,2,3) might produce
000000x - this row has six spaces
x00xxx0 - this row has three x
0xx0000 - this row has two xs
Each column contains one and only one 'x' the maximum number of spaces is 6,
the minimum number of times 'x' appears together is 2.
This should keep producing different combinations that fit the rules until
all possible combinations are exhausted.
In the variations produced, we don't need to achieve either the maximum or
minimum number of x in a row. It just need to fall within the parameters.
BuildGrid(4,2,4,1,6) might produce
00xx00x
xx00xxx
xxx0xx0
000x000
The combination of rows two and three produce six x in a row.