I want to simulate the 3D configuration of a real die. I know the sum of opposite faces equals 7 (top: 1 + bottom:6 = 7). Let's say the top face is 1, front is 5, right is 4, back is 2, left is 3 and bottom is 6, as this image suggests.
The real position matters for my code, so how do I randomize a die correctly? For example, if the randomized result top is 1 and the front is 5, then the right side has to be 4. It can't be 3, because in a real die, the 3 would be in the left. The program have to randomize 2 adjacent faces, the others must be placed according to the 2 randomized adjacent faces.
Pseudocode is just fine, but if you can explain me just with text, I appreciate it too.