The challenge: Generate a list of all possible input combinations given a finite list of inputs and the length of the combinations. The twist is that the combinations should be ordered so that each subsequent combination builds on the last one. Faster is better.
C, the dumb list would be
Optimally ordered, you would get:
So the user can simply input
AABAACAA to test 7 combinations, then start over from
ABC. Interruptions in the sequence are allowed.
The challenge comes from the newly released game
Fez and would be used to attempt to brute force a solution to a problem (by splitting chunks of inputs between multiple users).
I wrote an implementation of what I want (with additional constraints like a character can never repeat three times in a row) in this gist but I really don't think this is optimal.