一起过来打牌
ArrayList<String> puke=new ArrayList<>();
String[] color={"♠","♥","♣","♦"};
String[] number={"2","A","K","Q","J","10","9","8","7","6","5","4","3"};
puke.add("大王");
puke.add("小王");
for (String s : color) {
for (String s1 : number) {
puke.add(s+s1);
}
}
Collections.shuffle(puke);
ArrayList<String>wanjia1 = new ArrayList<>();
ArrayList<String>wanjia2 = new ArrayList<>();
ArrayList<String>wanjia3 = new ArrayList<>();
ArrayList<String>dipai = new ArrayList<>();
for (int i = 0; i < puke.size(); i++) {
String p = puke.get(i);
if (i>=51){
dipai.add(p);
}else if (i%3==0){
wanjia1.add(p);
}else if (i%3==1){
wanjia2.add(p);
}else if (i%3==2){
wanjia3.add(p);
}
}
System.out.println("熊大"+wanjia1);
System.out.println("熊二"+wanjia2);
System.out.println("光头强"+wanjia3);
System.out.println(dipai); |
|