I really tried to get the advanced piece done for this one. I was able to get an dynamic number of states including having different numbers of states for each tool. My example shows three tools, one with two, one with three, and one with four states. I couldn't figure out how to get an dynamic number of tools, though. Looking forward to seeing others' solutions.
(In looking at some of the other solutions I think I bit off more than I could chew when I went for allowing different tools to have different numbers of states. If I kept them all the same I could have gone for the counting and base conversion approach I was thinking of originally.)
Recently encountered a problem like this at work. My colleagues were able to help me solve it and one even told me it was a weekly challenge! So clever to use binary logic to do the combinations!