I just didn't explain very well ...
I have 10 variables, each with 3 possible values (#0, #1 and #2).
The #3 value is just a value to exclude from the combinations.
It's the same as counting in base 3.
If I had 10 variables, the number of cases would be 3**10.
So the test sequence goes like this for 3 variables:
000
001
002
010
011
012
020
021
022
100
101
102
110
111
112
120
121
122
200
201
202
210
211
212
220
221
222
More clear? (I hope)