模拟斗地主发牌
1.无序版
import java.util.ArrayList;
import java.util.Collections;
/**
* @Author: King
* @Description:人类的伟大是勇气的伟大,人类的赞歌是勇气的赞歌
* @Creat: 2021-12-06-15:36
*/
public class Test5 {
public static void main(String[] args) {
//1.创建一个牌盒子
ArrayList<String> pokerBox = new ArrayList<>();
//2.生成54张牌放进牌盒子
String[] colors = {"♣", "♠", "♦", "♥"};
String[] nums = {"A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"};
for (String color : colors) {
for (String num : nums) {
String poker = color.concat(num);
pokerBox.add(poker);
}
}
//手动添加大小王
pokerBox.add("👸");
pokerBox.add("🤴");