import java.util.*;
public class Test2 {
创建Map集合,键:编号 值:牌
Map<Integer,String> pokes=new HashMap<>();
//创建List集合
List<Integer> list=new ArrayList<>();
public void init(){
//创建List集合,存储颜色
List<String> color = new ArrayList<>();
//创建List集合,存储点数
List<String> num = new ArrayList<>();
Collections.addAll(color,"黑桃","红桃","方块","梅花");
Collections.addAll(num,"2","A","K","Q","J","10","9","8","7","6","5","4","3");
int count=1;
pokes.put(count++,"大王");
pokes.put(count++,"小王");
//遍历数组,用花色+点数的组合,存储到Map集合中
for (String s : num) {
for (String s1 : color) {
String all=s+s1;
斗地主
最新推荐文章于 2020-09-08 11:36:59 发布