Hey guys,
I'm sure that I am over complicating this problem too much while trying to find a solution for it, but regardless, I'm at a loss as to where to go.
I have a task to create a script to dynamically generate all of the possible scenarios for a set of information. The information I'm looking for is a set of zeros and ones (basically on/off flags) in all possible combinations for a variable set of options.
While this is just the part I'm having difficulty with, I need to be able to have a user enter a number (any number should be accepted) and then store the possible combinations into a manner that can be easily manipulated later.
For instance, if a user enters 3, the script should store the values:
While I'm sure this should be fairly straight forward, I'm at a loss as to how to get the coding around this. Any help would be appreciated.
- Rieekan
I'm sure that I am over complicating this problem too much while trying to find a solution for it, but regardless, I'm at a loss as to where to go.
I have a task to create a script to dynamically generate all of the possible scenarios for a set of information. The information I'm looking for is a set of zeros and ones (basically on/off flags) in all possible combinations for a variable set of options.
While this is just the part I'm having difficulty with, I need to be able to have a user enter a number (any number should be accepted) and then store the possible combinations into a manner that can be easily manipulated later.
For instance, if a user enters 3, the script should store the values:
Code:
1,0,0
1,1,0
1,0,1
1,1,1
0,1,0
0,1,1
0,0,1
0,0,0
While I'm sure this should be fairly straight forward, I'm at a loss as to how to get the coding around this. Any help would be appreciated.
- Rieekan