import java.util.*;

public class Game
{
    // hard coded that number of players is 2

    public Game (boolean debug)
    {
        _winningDeck = null;
        _debug = debug;
    }

    public final int play (Deck[] decks)
    {
        int round = 1;
        int game = 1;

        return _winningDeck.score();
    }

    private Deck recursiveCombat (int round, int game, Deck[] decks, int[] offsets)
    {
        Deck[] theDecks = new Deck[2];

        theDecks[0] = new Deck(decks[0], offsets[0]);
        theDecks[1] = new Deck(decks[1], offsets[1]);

        HashSet<String> rounds = new HashSet<String>();

        while (!decks[0].isEmpty() && !decks[1].isEmpty())
        {
            if (_debug)
            {
                System.out.println("\n-- Round "+round+" (Game "+game+") --");
                System.out.println(theDecks[0]);
                System.out.println(theDecks[1]);
            }

            if (!rounds.add(theDecks[0].stringForm() + theDecks[1].stringForm()))
                return decks[0];

            int playerOneCard = theDecks[0].draw();
            int playerTwoCard = theDecks[1].draw();

            if (_debug)
            {
                System.out.println("Player 1 plays: "+playerOneCard);
                System.out.println("Player 2 plays: "+playerTwoCard);
            }

            if ((theDecks[0].size() >= playerOneCard) && (theDecks[1].size() >= playerTwoCard))
            {
                if (recursiveCombat(1, game++, theDecks, new int[] { playerOneCard, playerTwoCard}) == theDecks[0])
                {
                    if (_debug)
                        System.out.println("Player 1 wins the round!");

                    theDecks[0].add(playerOneCard);
                    theDecks[0].add(playerTwoCard);
                }
                else
                {
                    if (_debug)
                        System.out.println("Player 2 wins the round!");

                    theDecks[1].add(playerOneCard);
                    theDecks[1].add(playerTwoCard);
                }
            }
            else
            {
                if (playerOneCard > playerTwoCard)
                {
                    if (_debug)
                        System.out.println("Player 1 wins the round!");

                    theDecks[0].add(playerOneCard);
                    theDecks[0].add(playerTwoCard);
                }
                else
                {
                    if (_debug)
                        System.out.println("Player 2 wins the round!");

                    theDecks[1].add(playerTwoCard);
                    theDecks[1].add(playerOneCard);
                }
            }

            round++;
        }

        if (_debug)
        {
            System.out.println("\n== Post-game results ==");
            System.out.println(theDecks[0]);
            System.out.println(theDecks[1]);
        }

        return null;
    }

    private Deck _winningDeck;
    private boolean _debug;
}
@@ -123,37 +123,8 @@
   %7B%0A
-        _winningDeck = null;%0A
     
@@ -241,16 +241,56 @@
 ame = 1;
+%0A        Deck winningDeck = new Deck(0);
 %0A%0A      
@@ -298,17 +298,16 @@
  return 
-_
 winningD
@@ -408,16 +408,34 @@
  offsets
+, Deck winningDeck
 )%0A    %7B%0A
@@ -1561,16 +1561,22 @@
 TwoCard%7D
+, null
 ) == the
@@ -2954,58 +2954,181 @@
     
-return
+if (winningDeck !=
  null
-;
+)
 %0A    
-%7D%0A%0A
     
-private Deck _winningDeck;
+    winningDeck = (theDecks%5B1%5D.isEmpty() ? theDecks%5B0%5D : theDecks%5B1%5D);%0A%0A        return (theDecks%5B1%5D.isEmpty() ? decks%5B0%5D : decks%5B1%5D);%0A    %7D%0A
 %0A   

Update Game.java