JJ楼主升级收藏怎么玩?
1.发牌,确保玩家的牌值排列为1。创建一个组合来存储号码和花色。2.在集合中添加元素,可以使用集合工具类一次性完成。3.将花色和相应的数字组合起来。请注意,外部循环是一个数字。准备要发给玩家的卡值排序。4.定义牌值比较的双栏集,以指定每个组合的牌值大小。5.定义玩家和卡片。6.将集合定义为双列集合中的对应键,并使用set工具类对元素进行无序排列。7.遍历双列集合,将乱序集合元素作为参数获取值分配给每个玩家和卡片。8.打印并测试每个许可导入java.util.ArrayList的结果;导入Java . util . collections;导入Java . util . hashmap;导入Java . util . set;导入Java . util . treemap;public class kapai 2 { \ x09 public static void main(string[]args){/\ x09 \ x09定义花色和牌值\ x09 \ x09 string[]s 1 = new string[]{ "?,"?","◆","?"};\ x09 \ x09 String[]S2 = new String[]{ " A "," 2 "," 3 "," 4 "," 5 "," 6 "," 7 "," 8 "," 9 "," 10 "," J "," Q "," K " };//\x09\x09定义player \ x09 \ x09 ArrayList cards = new ArrayList();\ x09 \ x09 ArrayList card = new ArrayList();\ x09 \ x09 ArrayList p 1 = new ArrayList();\ x09 \ x09 ArrayList p2 = new ArrayList();\ x09 \ x09 ArrayList P3 = new ArrayList();\x09\x09//\x09\x09拼写\ x09 \ x09 for(int I = 0;我