JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
* Author : Gaurav Agrawal
* type : combination one
* Created on : 27 dec 2017
* ♥️Challenge♥️ Shuffling a new deck of cards
Assume a new deck of cards is organized as follows:
♠️1, ♠️2, ..., ♠️10, ♠️J, ♠️Q, ♠️K, ♦️1, ♦️2, ..., ♦️10, ♦️J, ♦️Q, ♦️K, ♣️1, ♣️2, ..., ♣️10, ♣️J, ♣️Q, ♣️K, ♥️1, ♥️2, ..., ♥️10, ♥️J, ♥️Q, ♥️K
Write a program to do the followings:
1. Generate a new deck of cards and print it nicely!
2. Shuffle and print it three times!by after div. into 2 parts first & maintain the order of the two parts ... don't mix cards randomly
*/
import java.util.Random;
public class GauravProgram{
public static void main(String[] args){
String[] spe_name={"jck","qen","kng","clb_", "spd_", "dmnd_", "hrt_"};
String[] name=new String[52];
for(int a=0;a<52;a++){
name[a]="";
name[a]+=(a%13==10)?spe_name[0]:(a%13==11)?spe_name[1]:(a%13==12)?spe_name[2]:""+(a%13+1);
name[a]=spe_name[a/13+3]+name[a];}
printCards(name);
for(int l=1;l<=3;l++){
int p1=0,p2=0,p3=0,i=0;
String[] init=new String[26]; String[] finit=new String[26];
for(;p1<26;p1++){
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run