public class War {
public static void main(String args[])
{
ArrayList<Integer> deck = new ArrayList<>(List.of(2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5,
5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11,
12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14));
// Creates a deck and shuffles it
Collections.shuffle(deck);
System.out.println(deck);
ArrayList<Integer> player1 = new ArrayList<>();
ArrayList<Integer> player2 = new ArrayList<>();
System.out.println(player2);
System.out.println(player1);
}
}
This is for my card war game where I want to split the deck arraylist in half (2 lists) and then be able to use those 2 lists as the cards for the 2 players.