package lianxi;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
public class DouDiZhu {
/**
* "♠""♥""♦""♣""小☺""大☻"
*/
public static void main(String[] args) {
ArrayList<String>cloor=new ArrayList<String>();
cloor.add("♠");
cloor.add("♥");
cloor.add("♦");
cloor.add("♣");
ArrayList<String> number=new ArrayList<String>();
Collections.addAll(number,"3","4","5","6","7","8","9","10","J","Q","K","A","2" );
HashMap<Integer, String> map=new HashMap<Integer, String>();
int num=0;
for (String number2: number) {
for (String cloor2 : cloor) {
map.put(num,cloor2+number2);
num++;
}
}
map.put(num++,"小☺");
map.put(num++,"小☻");
ArrayList<Integer> list=new ArrayList<Integer>();
for (int i = 0; i <54; i++) {
list.add(i);
}
Collections.shuffle(list);
// for (Integer integer : list) {
// System.out.println(integer);
// }
ArrayList<Integer> paly=new ArrayList<Integer>();
ArrayList<Integer> paly2=new ArrayList<Integer>();
ArrayList<Integer> paly3=new ArrayList<Integer>();
ArrayList<Integer> dipai=new ArrayList<Integer>();
for (int i = 0; i <54 ; i++) {
if(i>50){
dipai.add(list.get(i));
}else{
if(i%3==0){
paly.add(list.get(i));
}
if(i%3==1){
paly2.add(list.get(i));
}if(i%3==2){
paly3.add(list.get(i));
}
}
}
Collections.sort(paly);
Collections.sort(paly2);
Collections.sort(paly3);
for (Integer integer : paly) {
System.out.print(map.get(integer)+" ");
}
System.out.println();
for (Integer integer : paly2) {
System.out.print(map.get(integer)+" ");
}
System.out.println();
for (Integer integer : paly3) {
System.out.print(map.get(integer)+" ");
}
System.out.println();
for (Integer integer : dipai) {
System.out.print(map.get(integer)+" ");
}
}
}
|