Re: problem with Random()
Are you trying to make it so that the number is likely to get bigger the further you go?
All you have to do is make t = r.nextInt(i+1), so when i=0 it does r.nextInt(1) [Always 0!]
Are you trying to make each a random number?
Choose a max number and always call it like so: r.nextInt(100) [A psuedorandom number between 0 and 99]
Are you trying to make a set of unique values in a random order?
Look into the Collections.shuffle(List<?> list) method, although it would be a bit more complicated because it is a 2d array, but in effect you shuffle each deck in the array with Collections.shuffle(Arrays.asList(cards[i])) where i is a incrementing counter, then you shuffle Arrays.asList(cards) and bam, you got it.
Re: problem with Random()
Hello.
Iam trying to make it load the numbers two times like this in the logg:
03-23 21:42:38.519: INFO/loadCards()(359): size=12
03-23 21:42:38.529: INFO/loadCards()(359): card[3][2]=4
03-23 21:42:38.529: INFO/loadCards()(359): card[2][2]=0
03-23 21:42:38.529: INFO/loadCards()(359): card[1][2]=1
03-23 21:42:38.529: INFO/loadCards()(359): card[0][2]=4
03-23 21:42:38.529: INFO/loadCards()(359): card[3][1]=5
03-23 21:42:38.529: INFO/loadCards()(359): card[2][1]=5
03-23 21:42:38.529: INFO/loadCards()(359): card[1][1]=2
03-23 21:42:38.529: INFO/loadCards()(359): card[0][1]=1
03-23 21:42:38.529: INFO/loadCards()(359): card[3][0]=2
03-23 21:42:38.539: INFO/loadCards()(359): card[2][0]=3
03-23 21:42:38.539: INFO/loadCards()(359): card[1][0]=0
03-23 21:42:38.539: INFO/loadCards()(359): card[0][0]=3
This is the logg when i changed the code to t = r.nextInt(i+1) and it seems that it did the trick, iam going to test this some more but it seems good right now.
Thanks for the help.
Re: problem with Random()
It appears you want a set of psuedorandom numbers, in which it would be better to have that line something closer to
t = r.nextInt(6);
Which would be a random number between 0 and 5.