Hello Member numbered,
you're looking for a 'fuzzing' method.
from a strings array, your project require an exhaustive output of all existing combinations.
I note your output are mutliple types of array : one dimension/n-dimension.
start at ground.
take 0 and 1 as basis.
it could be binary / integer / or strings [ at end all symbols and types ]
* in a loop to fill 'output array' for all combination :
divide your fuzzing method in 2 steps ( all capitals )
- soft cases : allocation is direct. output[slot] with slot under dictionary array length
else :
- hard cases : a concatenation is required before allocation in the output array.
** easy path for understanding, by another method
a bitset ( c++ ) with length of 64 owns billions or more solutions for you.
each 0 or 1 stand for the symbol to put or not. ( CharAt / indexof( array(i),position ) )
then substitute the 0||1 by the slot in the array dictionnary.
you'll get all the pattern required for your _first step_ BIG list of combination.
create a bitset
loop on bitset++;
fill an array with all those.=> it's equal to an exhaustive _binary tree_ with a depth of 64
as your outputs are multiple types of array,
take your 'exhaustive solutions tree' as a start point to build all your output.
it makes few more functions to write filling your arrays/structure with all row from your 'solution tree'.
sure, it's not the more effiscient method but a first and fixed solution.
as it's readable and understandable easily.
UPDATE :
from the all vars as inputs of your function, you're trying to use 'recursive style' to write this function.
work on 'recursion' first.
or land your code to write as usual. ( it's not shorter, but hard to read and write in recursive style )
UPDATE :
about your output, hardcode it
each output needed is a structure or map of your datas
make a function for every output pattern you need.
go as simple as possible.
declare last_ouput before the loop
for each row in big_solution_tree
try
return_structure_A(row);
end try
try
return_structure_B(row);
end try
try
return_structure_C(row);
end try
try
return structure_D(row);
end try
..............................
try
return_structure_M(row);
end try
end try
next each
void return_structure_A( row ){
last_output.Add( = ................... the pattern of output );
last_output.next();
}
void return_structure_B( row ){
last_output[].Add( ................... the pattern of output B );
last_output.next();
}