一、斗地主排序
package com.zhongruan;
import java.util.*;
public class DouDiZhu2 {
public static void main(String[] args) {
//1.拿到一副牌
Map<Integer,String> poker=new HashMap<>();
String[] nums={“A”,“2”,“3”,“4”,“5”,“6”,“7”,“8”,“9”,“10”,“J”,“Q”,“K”};
String[] colors={"黑桃","红心","梅花","方块"};
int index=0;
for(String color:colors){
for(String num:nums){
String pai=color+num;
index=index+1;
poker.put(index,pai);
}
}
System.out.println(index);
index++;
poker.put(index,"大王");
index++;
poker.put(index,"小王");
System.out.println(poker);
//2.洗牌
List<Integer> pokerIndexs=new ArrayList<>();
Set<Integer> integers = poker.keySet();
// System.out.println(integers);
for(Integ