I’d call it “enumerating a list of all combinations”. There’s a field of math called “combinatorics” which I did not study but I assume probably has a word for this. It doesn’t seem like a puzzle so much as a task. It quickly becomes a massive amount of work with massive output if you have more and more values, because they all multiply together to get the number of possible combinations. i.e. nCombinations = nFOOs x nBARs x nBAZs… Your approach sounds fundamentally correct. The tree analogy is a nice visual metaphor, but I think it will be simpler to program it without thinking of it. That is, I think you can “just” do a recursion. Make a function that takes such a list as input, and what it does is goes through every value for the first key, writes the key and each value in turn, followed by the output of a call to that same function, called with a list of all the key/values except the first one that is being iterated by the current execution. ... Er… I suppose you also need to take a parameter for the previous text to repeat for each iteration, and tweak it to get the output format you want, but that’s essentially it, I think.