# 斗地主发牌理牌

   private static <list> void swap(List<list> list,int a,int b) {
list list1=list.get(a);
list.set(a, list.get(b));
list.set(b, list1);
}

private static ArrayList<String> zhengli(ArrayList<String> x){
ArrayList<Integer> a=new ArrayList<>();
int b=-1;

for (int i = 0; i < x.size(); i++) {
if(x.get(i).equals("大王"))
b=170;
else if(x.get(i).equals("小王"))
b=160;
else {
if (x.get(i).substring(1).equals("A"))
b = 140;
else if (x.get(i).substring(1).equals("2"))
b = 150;
else if (x.get(i).substring(1).equals("J"))
b = 110;
else if (x.get(i).substring(1).equals("Q"))
b= 120;
else if (x.get(i).substring(1).equals("K"))
b = 130;
else b= Integer.parseInt(x.get(i).substring(1)) * 10;

if(x.get(i).substring(0,1).equals("♥")){
b+=4;
}else if(x.get(i).substring(0,1).equals("♦")){
b+=3;
}else if(x.get(i).substring(0,1).equals("♠")){
b+=2;
}else if(x.get(i).substring(0,1).equals("♣")){
b+=1;
}
}
}

for (int i = x.size(); i > 1; i--) {
for (int j = 0; j < i-1; j++) {
if(a.get(j) < a.get(j+1)){
swap(a,j,j+1);
swap(x,j,j+1);
}
}
}

return x;
}

public static void main (String[]args){
List<String> pokes = new ArrayList<>();
List<String> colors = new ArrayList<>();
List<String> numbers = new ArrayList<>();

for (int i = 2; i <= 10; i++) {
}
for (String c : colors) {
for (String n : numbers) {
String pai = c + n;
}
}
System.out.println(pokes);
Collections.shuffle(pokes);
System.out.println(pokes);

ArrayList<String> a = new ArrayList<>();
ArrayList<String> b = new ArrayList<>();
ArrayList<String> d = new ArrayList<>();
ArrayList<String> dipai = new ArrayList<>();
for (int i = 0; i < pokes.size(); i++) {
String pai = pokes.get(i);
if (i > 51) {
} else {
if (i % 3 == 0) {
} else if (i % 3 == 1) {
} else {
}
}

}
System.out.println(dipai);
System.out.println(a);
System.out.println(b);
System.out.println(d);
a=zhengli(a);
b=zhengli(b);
d=zhengli(d);
dipai=zhengli(dipai);

System.out.println("\n整理后：");
System.out.println(a);
System.out.println(b);
System.out.println(d);
System.out.println(dipai);

}
}


[❥2, ❥3, ❥4, ❥5, ❥6, ❥7, ❥8, ❥9, ❥10, ❥A, ❥J, ❥Q, ❥K, ♠2, ♠3, ♠4, ♠5, ♠6, ♠7, ♠8, ♠9, ♠10, ♠A, ♠J, ♠Q, ♠K, ♦2, ♦3, ♦4, ♦5, ♦6, ♦7, ♦8, ♦9, ♦10, ♦A, ♦J, ♦Q, ♦K, ♣2, ♣3, ♣4, ♣5, ♣6, ♣7, ♣8, ♣9, ♣10, ♣A, ♣J, ♣Q, ♣K, 大王, 小王]
[小王, ♣3, ♠7, ❥3, ♠A, ♣9, ♠2, ♦7, ❥5, ♦9, ♠8, ❥6, ♣Q, ♠10, ♠K, ♦10, ❥K, ♣7, 大王, ♣2, ♦5, ❥A, ♠5, ❥9, ♦4, ♣10, ♣5, ♣8, ♣4, ♣A, ♦6, ❥J, ♠Q, ♦2, ♦Q, ♦A, ♣J, ♠9, ♣K, ♣6, ❥7, ❥2, ♠3, ❥8, ❥10, ❥Q, ♦J, ♦K, ♦8, ❥4, ♠J, ♦3, ♠6, ♠4]
[♠6, ♠4]
[小王, ❥3, ♠2, ♦9, ♣Q, ♦10, 大王, ❥A, ♦4, ♣8, ♦6, ♦2, ♣J, ♣6, ♠3, ❥Q, ♦8, ♦3]
[♣3, ♠A, ♦7, ♠8, ♠10, ❥K, ♣2, ♠5, ♣10, ♣4, ❥J, ♦Q, ♠9, ❥7, ❥8, ♦J, ❥4]
[♠7, ♣9, ❥5, ❥6, ♠K, ♣7, ♦5, ❥9, ♣5, ♣A, ♠Q, ♦A, ♣K, ❥2, ❥10, ♦K, ♠J]

[大王, 小王, ♦2, ♠2, ❥A, ♣Q, ❥Q, ♣J, ♦10, ♦9, ♦8, ♣8, ♦6, ♣6, ♦4, ♦3, ♠3, ❥3]
[♣2, ♠A, ❥K, ♦Q, ♦J, ❥J, ♠10, ♣10, ♠9, ♠8, ❥8, ♦7, ❥7, ♠5, ♣4, ❥4, ♣3]
[❥2, ♦A, ♣A, ♦K, ♠K, ♣K, ♠Q, ♠J, ❥10, ♣9, ❥9, ♠7, ♣7, ❥6, ♦5, ♣5, ❥5]
[♠6, ♠4]

06-25 49

06-24 64

06-27 121

06-28 54

01-06 1106

06-26 61

08-11 2212

08-18 503

01-14 733

03-02 66

#### Java简单实现斗地主洗牌、发牌

©️2020 CSDN 皮肤主题: 数字20 设计师: CSDN官方博客

1.余额是钱包充值的虚拟货币，按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载，可以购买VIP、C币套餐、付费专栏及课程。