import java.util.Random;

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

public class Shuffle
{

    public static void main (String args[])
    {
	boolean finished = false;

	initialiseSuite(_hearts);
	initialiseSuite(_spades);
	initialiseSuite(_clubs);
	initialiseSuite(_diamonds);

	while (!finished)
	{
	    int theSuite = randSuite.nextInt(3);
	    int theCard;

	    // choose card.

	    switch (theSuite)
	    {
	    case 0:
		theCard = getCard(_hearts, _heartsLeft);
		break;
	    case 1:
		theCard = getCard(_spades, _spadesLeft);
		break;
	    case 2:
		theCard = getCard(_clubs, _clubsLeft);
		break;
	    case 3:
		theCard = getCard(_clubs, _clubsLeft);
		break;
	    default:
		// error
		break;
	    }
	}
    }

    private int getCard (int[] suite, int left)
    {
	if (left == 0)
	    return -1;

	for (;;)
	{
	    int theCard = randCard.nextInt(13);
	}
    }

    private void initialiseSuite (int[] suite)
    {
	for (int i = 0; i < suite.length(); i++)
	{
	    if (i == 0)
		suite[i] = 11;
	    else
	    {
		if (i >= 10)
		    suite[i] = 10;
		else
		    suite[i] = i;
	    }
	}
    }

    private Random _randSuite = new Random();
    private Random randCard = new Random();

    // hack!!

    private int[] _hearts = new int[13];
    private int _heartsLeft = 13;
    private int[] _spades = new int[13];
    private int _spadesLeft = 13;
    private int[] _clubs = new int[13];
    private int _clubsLeft = 13;
    private int[] _diamonds = new int[13];
    private int _diamondsLeft = 13;
}
@@ -168,16 +168,33 @@
  args%5B%5D)
+ throws Exception
 %0A    %7B%0A%09
@@ -392,16 +392,18 @@
 xtInt(3)
++1
 ;%0A%09    i
@@ -477,17 +477,17 @@
    case 
-0
+1
 :%0A%09%09theC
@@ -534,33 +534,33 @@
 reak;%0A%09    case 
-1
+2
 :%0A%09%09theCard = ge
@@ -599,33 +599,33 @@
 reak;%0A%09    case 
-2
+3
 :%0A%09%09theCard = ge
@@ -662,33 +662,33 @@
 reak;%0A%09    case 
-3
+4
 :%0A%09%09theCard = ge
@@ -748,23 +748,64 @@
 / error%0A
+%0A
 %09%09
-break
+throw new Exception(%22Invalid card %22+theSuite)
 ;%0A%09    %7D
@@ -1286,16 +1286,82 @@
 dom();%0A%0A
+    private static final char%5B%5D _initialSuits = %22A123456789XJQK%22;%0A
     // h
@@ -1396,33 +1396,33 @@
 arts = new int%5B1
-3
+4
 %5D;%0A    private i
@@ -1471,33 +1471,33 @@
 ades = new int%5B1
-3
+4
 %5D;%0A    private i
@@ -1545,33 +1545,33 @@
 lubs = new int%5B1
-3
+4
 %5D;%0A    private i
@@ -1629,17 +1629,17 @@
 ew int%5B1
-3
+4
 %5D;%0A    p

Update Shuffle.java