public class Collectiontest {
/**
* Three steps to play a landlord:
* A Buy Card
* B Shuffle
* C Licensing
* D look at the cards
*/
public static void Main (string[] args) {
String[] color={"Spades", "Red Peach", "Plum", "block"};
String[] numbers={"A", "2", "3", "4", "5", "6", "7", "8", "9", "Ten", "J", "Q", "K"};
Arraylist<string> array=new arraylist<string> ();
Array.add ("King");
Array.add ("Xiao Wang");
for (String C:color) {
for (String n:numbers) {
Array.add (C.concat (n));
}
}
Collections.shuffle (array);
SYSTEM.OUT.PRINTLN (array);
System.out.println (Array.size ());
Three people
Arraylist<string> xiaoming1=new arraylist<string> ();
Arraylist<string> xiaoming2=new arraylist<string> ();
Arraylist<string> xiaoming3=new arraylist<string> ();
for (int i = 0; i < array.size ()-3; i++) {
if (i%3==0) {
Xiaoming1.add (Array.get (i));
}else if (i%3==1) {
Xiaoming2.add (Array.get (i));
}else if (i%3==2) {
Xiaoming3.add (Array.get (i));
}
}
System.out.println (XIAOMING1);
System.out.println (XIAOMING2);
System.out.println (XIAOMING3);
Look at the cards
for (int i = Array.size ()-3; I < array.size (); i++) {
System.out.print (Array.get (i) + "");
}
}
}