Lets say you have three buttons, button1, button2, and button3. Three buttons, have 2^3+1 = 9 possible binary states.
Each state will pull and retrieve data from a database based on the combination toggle states of the button. However, not all data exists for every combination. For example:
000 - exists
010 - not exist
011 - not exist
100 - exists
101 - exists
110 -not exist
111 - exists
So now the problem is, how do I design the system so that when a user clicks a toggle button, the remaining possible buttons are either disabled or enabled? I've thought about using a three-dimensional array but the problem is, when I have to add 30 toggle buttons, this looping becomes tediouis as each time a toggle button is clicked, the software has to iterate through every possible combination again to check whether the truth table for that combination exist.
lets say from the above example, the user toggle button 1, which is 001. His next possible choices are 101 and 111. He can NOT choose 011 but the problem is 111 exists but to get to 111 he has to click button3 first, then button2, to get to state 111. Because if he clicks button 2 first, his state becomes 011 and no data will be retrieved.
View Complete Post