黑马程序员技术交流社区
标题:
上次没注意,发的不完整(如来玉帝玩儿斗地主继续)
[打印本页]
作者:
Flyxiang
时间:
2016-12-6 00:11
标题:
上次没注意,发的不完整(如来玉帝玩儿斗地主继续)
package PokerDemo;
/*
* 第一次 做的
*/
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
public class PokerTest {
public static void main(String[] args) {
//创造牌盒
HashMap<Integer, String> pokerBox=new HashMap<>();
//创造颜色
ArrayList<String> colors=new ArrayList<String>();
Collections.addAll(colors, "♦","♣","♥","♠");
//创造数字
ArrayList<String> numbers=new ArrayList<String>();
Collections.addAll(numbers, "3","4","5","6","7","8","9","10","J","Q","K","A","2");
int count=1;
//HashSet<Integer> num=new HashSet<Integer>();
ArrayList<Integer> num=new ArrayList<Integer>();
//创造牌面
for (String nums: numbers) {
for (String cs :colors ) {
num.add(count);
pokerBox.put(count++, cs+nums);
}
}
num.add(count);
pokerBox.put(count++, "小
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2