It looks like japhy has done something along those lines: Cartesian Cross-Products. You could've saved some time with a Super Search on "cartesian cross".
in reply to Cartesian Cross Product Module? Prelude to Decision Trees.
And though this is falling on deaf ears for certain, "I want..." isn't a question. Monks aren't here to do your dirty work for you when you're more interested in another issue. Newbies are routinely encouraged to try a problem themselves before posting about it... I would certainly expect a veteran to do the same.