import java.util.Random;

/**
 * 56 card deck, no Jokers ... yet.
 *
 * Shuffle cards and then draw them down.
 */

public class Shuffle
{

    public static void main (String args[]) throws Exception
    {
	boolean finished = false;
	int cardsDealt = 0;

	while (!finished)
	{
	    int theSuite = randSuite.nextInt(3)+1;
	    char theCard = NOCARD;
	    String suite = "";

	    System.out.println("**Suite chosen "+theSuite);

	    // choose card.

	    switch (theSuite)
	    {
	    case 1:
		theCard = getCard(hearts);
		suite = "Hearts";
		break;
	    case 2:
		theCard = getCard(spades);
		suite = "Spades";
		break;
	    case 3:
		theCard = getCard(clubs);
		suite = "Clubs";
		break;
	    case 4:
		theCard = getCard(diamonds);
		suite = "Diamonds";
		break;
	    default:
		// error

		throw new Exception("Invalid card "+theSuite);
	    }

	    if (theCard != NOCARD)
	    {
		cardsDealt++;

		System.out.println("**cardsDealt "+cardsDealt);

		System.out.print("Card dealt: ");

		switch (theCard)
		{
		case 'A':
		    System.out.print("Ace");
		    break;
		case 'X':
		    System.out.print("10");
		    break;
		case 'J':
		    System.out.print("Jack");
		    break;
		case 'Q':
		    System.out.print("Queen");
		    break;
		case 'K':
		    System.out.print("King");
		    break;
		default:
		    System.out.print(theCard);
		    break;
		}

		System.out.println(" of "+suite);
	    }

	    if (cardsDealt == 56)
		finished = true;
	}
    }

    private static char getCard (char[] suite)
    {
	int cardsLeft = 0;
	char toReturn = NOCARD;

	for (int i = 0; i < 14; i++)
	{
	    if (suite[i] != NOCARD)
		cardsLeft++;
	}

	System.out.println("**cards left "+cardsLeft);
	
	printSuite(suite);

	if (cardsLeft != 0)
	{
	    do
	    {
		int theCard = randCard.nextInt(14);
		
		toReturn = suite[theCard];

		System.out.println("**selected "+theCard+" and "+toReturn);

		if (toReturn != NOCARD)
		    suite[theCard] = NOCARD;
	    }
	    while (toReturn == NOCARD);
	}

	System.out.println("**dealing "+toReturn);

	printSuite(suite);

	return toReturn;
    }

    private static final void printSuite (char[] suite)
    {
	for (int i = 0; i < 14; i++)
	{
	    switch (suite[i])
	    {
	    case NOCARD:
		System.out.print("blank");
		break;
	    default:
		System.out.print(suite[i]);
		break;
	    }

	    System.out.print(", ");
	}

	System.out.println();
    }

    private static Random randSuite = new Random();
    private static Random randCard = new Random();

    private static char[] hearts = { 'A', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'X', 'J', 'Q', 'K' };
    private static char[] spades = { 'A', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'X', 'J', 'Q', 'K' };
    private static char[] clubs = { 'A', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'X', 'J', 'Q', 'K' };
    private static char[] diamonds = { 'A', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'X', 'J', 'Q', 'K' };

    private static final char NOCARD = ' ';
}

@@ -309,17 +309,17 @@
 nextInt(
-3
+4
 )+1;%0A%09  
@@ -368,16 +368,23 @@
  = %22%22;%0A%0A
+%09    //
 %09    Sys
@@ -906,59 +906,8 @@
 +;%0A%0A
-%09%09System.out.println(%22**cardsDealt %22+cardsDealt);%0A%0A
 %09%09Sy
@@ -1592,57 +1592,10 @@
 %7D%0A%0A%09
-System.out.println(%22**cards left %22+cardsLeft);%0A%09%0A
+//
 %09pri
@@ -1719,24 +1719,27 @@
 heCard%5D;%0A%0A%09%09
+// 
 System.out.p
@@ -1748,17 +1748,17 @@
 ntln(%22**
-s
+S
 elected 
@@ -1884,24 +1884,27 @@
 OCARD);%0A%09%7D%0A%0A
+%09//
 %09System.out.
@@ -1914,17 +1914,17 @@
 ntln(%22**
-d
+D
 ealing %22
@@ -1936,16 +1936,19 @@
 turn);%0A%0A
+%09//
 %09printSu

Update Shuffle.java