How do I compute the cartesian product of n sequences in F#?
I was given a puzzle as a present. It consists of 4 cubes, arranged side by side. The faces of each cube are one of four colours. To solve the puzzle, the cubes must be orientated so that all four cubes' tops are different, all their fronts are different, all their backs are different and all their bottom's are different. The left and right sides do not matter. My pseudo-code solution was: Create a representation of each cube. Get all the possible orientations of each cube (there are 24 for each). Get all the possible combinations of orientations of each cube. Find the combination of