小程序功能介绍
功能:可以将54张扑克牌顺序打乱然后分给四个人,并且每个人手中的牌按照从大到小的顺序码好。
package Poker;
import java.util.*;
public class Test1 {
public static void main(String[] args) {
//存放牌组
Map<Integer,String> poker=new HashMap<>();
List<String> mun=new ArrayList<>();
List<String> colour=new ArrayList<>();
Collections.addAll(mun,"2","A","k","Q","J","10","9","8","7","6","5","4","3");
Collections.addAll(colour,"红桃","黑桃","方块","梅花");
int count=1;
poker.put(count++,"大王");
poker.put(count++,"小王");
for (String s : mun) {
for (String s1 : colour) {
String str=s+s1;
poker.put(count++,str);
}