I am trying to figure how how to find all the combinations given the following information:
I start with a JSON dataset:
var choices = { 1: {\'Q\': 1
check this out: Combination Generator in Linq
Another solution without LINQ, assuming you will be doing this on only 4 things per row, the easiest thing is to just brute force it and do nested foreach loops.
foreach ( choice in allChoices )
{
foreach ( choice in allChoices )
{
foreach ( choice in allChoices )
{
foreach ( choice in allChoices )
{
// combine and add to a collection
}
}
}
}
edit: added objects to loop over in foreach loops