//创建创建扑克的静态方法,参数是牌的序号和一副扑克所有的牌
static void newpoker(ArrayList<Integer> NO,HashMap<Integer, String> poker){
//用集合的of方法写死花色,color不能再被add了
List<String> color =List.of("♠","♥","♣","♦");
//由于要排序,因此在number集合中首先把排序摆好
List<String> number=List.of("2","A","K","Q","J","10","9","8","7","6","5","4","3");
int index=0; //索引,加入到NO集合中
NO.add(index);
poker.put(index,"大王");//先加入大王,并且序号为0,最大
index++;
NO.add(index);
poker.put(index,"小王");//小王排第二
index
JAVA:从大到小牌序的斗地主案例
最新推荐文章于 2022-12-27 17:39:18 发布