1
I made a ArrayList
(nomeTimes
) which receives a number of team names as per the for
down below:
for(int i = 0; i<numeroTimes;i++){
String nomeTime=entrada.next();
nomeTimes.add(nomeTime);
}
My idea is to duplicate this ArrayList
and shuffle with:
Collections.shuffle(nomeTimes);
And put the two together Arraylists
in a third.
In this case it is to assemble a table with the confrontations of the teams. The confrontations stored in the third ArrayList
would look like this: [[a,b][a,c][a,d],[[b,a],[b,c],[b,d]]
.
How to unite the two in a third?
Do you want to assemble an Arraylist that has the confrontations? Could you tell us how you expect each String to look in this third Arraylist?
– Math
This, I thought for example, 4 teams, and everyone plays with each other, would be like [[a,b][a,c][a,d],[[b,c],[b,d]] and so on, I think it would be better to manipulate or complicate too much?
– haykou