54 simulated landlords and 54 landlords
54 cards simulate landlords
Package demo; import java. util. random;/*** 54 card shuffling and issuing cards **/public class Puker {public static void main (String [] args) {Random random = new Random (); // initialize the array String [] puker = {"♠A ","♠2 ","♠3 ","♠4 ","♠5 ","♠6 ","♠7 ","♠8 ","♠9 ","♠10 ","♠J ","♠Q ","♠K ","♥A ","♥2 ","♥3 ","♥4 ","♥5 ","♥6 ","♥7 ","♥8 ","♥9 ","♥10 ","♥J ","♥Q ","♥K ","♣A ","♣2 ","♣3 ","♣4 ","♣5 ","♣6 ","♣7 ","♣8 ","♣9 ","♣10 ","♣J ","♣Q ","♣K ","♦A ","♦2 ","♦3 ","♦4 ","♦5 ","♦6 ","♦7 ","♦8 ","♦9 ","♦10 ","♦J ","♦Q ","♦K "," "," "}; // declare the base card String [] p1 = new String [17] for three players. string [] p2 = new String [17]; String [] p3 = new String [17]; String [] bluff = new String [3]; // simulate shuffling for 1000 times (int I = 0; I <1000; I ++) {int r1 = random. nextInt (puker. length); int r2 = random. nextInt (puker. length); String tmp = puker [r1]; puker [r1] = puker [r2]; puker [r2] = tmp;} // transaction int index = 0; for (int I = 0; I <puker. length;) {if (I <3) {// retain three cards first bluff [I] = puker [I ++];} else {// licensed to three players p1 [index] = puker [I ++]; p2 [index] = puker [I ++]; p3 [index] = puker [I ++]; index ++ ;}} System. out. println ("base card:"); for (int I = 0; I <bluff. length; I ++) {System. out. print (bluff [I] + "");} System. out. println ("\ n Player 1 card:"); for (int I = 0; I <p1.length; I ++) {System. out. print (p1 [I] + "");} System. out. println ("\ n PLAYER 2 is:"); for (int I = 0; I <p2.length; I ++) {System. out. print (p2 [I] + "");} System. out. println ("\ n Player 3 is:"); for (int I = 0; I <p3.length; I ++) {System. out. print (p3 [I] + "");}}}