import java.util.*;
import java.lang.*;
import java.io.*;
// The main method must be in a class named "Main".
class Main {
static class Card {
String original;
char suit;
int rankValue;
int suitValue; // S=4, H=3, D=2, C=1, BLACKJOKER=10, REDJOKER=9;
public Card(String s) {
this.original = s;
if (s.contains("JOKER")) {
this.suit = 'Z';
this.rankValue = 14;
this.suitValue = s.equals("BLACKJOKER")? 10 : 9;
} else {
this.suit = s.charAt(0);
String num = s.substring(1);
this.rankValue = calculateRank(num);
this.suitValue = calculateSuit(this.suit);
}
}
private int calculateRank(String n) {
if (n.equals("A")) return 1;
if (n.equals("K")) return 13;
if (n.equals("Q")) return 12;
if (n.equals("J")) return 11;
return Integer.parseInt(n);
}
private int calculateSuit(char s) {
if (s=='S') return 4;
if (s=='H') return 3;
if (s=='D') return 2;
if (s=='C') return 1;
return 5;
}
}
public static void main(String[] args) {
char[] shape = new char[]{'H', 'S', 'C', 'D'};
ArrayList<Card> Deck = new ArrayList<>();
for (char c : shape) {
for (int i=1; i<14; i++) {
String num;
if (i==11) num = "J"; else if (i==12) num = "Q";
else if (i==13) num = "K"; else if (i==1) num="A"; else num = String.valueOf(i);
num = c+num;
Deck.add(new Card(num));
}
}
Deck.add(new Card("REDJOKER"));
Deck.add(new Card("BLACKJOKER"));
Collections.shuffle(Deck);
for (int i=0; i<54; i++) {
System.out.println(Deck.get(i).original);
}
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: