Java- Math.random(): Selecting an element of a 13 by 13 triangular array
问题 Edit: This problem is solved. If you would like to help on another problem, please visit Java Biasing Random Numbers in a Triangular Array. I'm doing a multiplication game, so I pick 2 numbers between 0 and 12 inclusive. If I do that like this: int num1 = (int)(Math.random() * 13); int num2 = (int)(Math.random() * 13); the squares (0x0,1x1,2x2,etc) are picked half the time (because 1x2 is the same as 2x1). How can I make all combinations picked at the same frequency? There are 91 possible