Let me preface this by saying that I've only taken 1 formal programming class and everything else I've learned is from trial and error or Google (forums, blogs). I have never taken an algorithm class or an advanced math class.
In the process of making my current application, I need to perform multiple checks and need complex if then statements in order to eliminate multiple possibilities (my datagridview, which I'm validating has at minimum of 9 fields to validate) all of which will require a separate function call.
In the process of doing this, I've noticed that I've begun to miss combinations and am looking to write a quick application to tell me the what all the combinations are. Essentially it'll have a listbox for the placeholders I'll be using to replace with the boolean operation in the project. The listbox will be associated with 1 boolean value in a boolean array. As it's looping through the array showing all the possibilities, I'll be lining up the values with the listbox.
The problem I'm having relates to how to output all the possible combinations of True/False values any number of booleans. How would I process through the array and flip the values as they need to be?
The output, for 3 values, I'm looking for would consist of:
F:ListBoxValue1 F:ListBoxValue2 F:ListBoxValue3
T:ListBoxValue1 F:ListBoxValue2 F:ListBoxValue3
T:ListBoxValue1 T:ListBoxValue2 F:ListBoxValue3
T:ListBoxValue1 T:ListBoxValue2 T:ListBoxValue3
F:ListBoxValue1 T:ListBoxValue2 T:ListBoxValue3
F:ListBoxValue1 F:ListBoxValue2 T:ListBoxValue3
F:ListBoxValue1 T:ListBoxValue2 F:ListBoxValue3
I don't need the code for the form or even include the listbox, just how to get all the combinations of the boolean array.
Thanks in advance!