package com.doudou_01;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class Doudizhu {
public static void main(String[] args) {
String[] floorColor = {"方块","梅花","红桃","黑桃"};
String[] nums = {"A","2","3","4","5","6","7","8","9","10","J","Q","K"};
//制造扑克牌
List<String> puke = new ArrayList<String>();
for(int i=0;i<floorColor.length;i++) {
for(int j=0;j<nums.length;j++) {
puke.add(floorColor[i]+nums[j]);
}
}
//添加大小王
puke.add("大王");
puke.add("小王");
//打印一下扑克牌
System.out.println(puke);
//洗牌
Collections.shuffle(puke);
//打印洗牌之后的牌
System.out.println(puke);
//三个打牌的a,b,c
List<String> a = new ArrayList<String>();
List<String> b = new ArrayList<String>();
List<String> c = new ArrayList<String>();
final int PEPLENUM = 3;
for(int i=0;i<puke.size()-3;i++){
if(i%PEPLENUM == 0) {
a.add(puke.get(i));
}else if(i%PEPLENUM == 1){
b.add(puke.get(i));
}else if(i%PEPLENUM == 2){
c.add(puke.get(i));
}
}
System.out.println("a的牌"+a.size());
System.out.println(a);
System.out.println("b的牌"+b.size());
System.out.println(b);
System.out.println("c的牌"+c.size());
System.out.println(c);
//打印底牌
for(int i=puke.size()-3;i<puke.size();i++) {
System.out.println(puke.get(i));
}
}
}