// network of machines.

public class Network
{
    public static final int NETWORK_SIZE = 50;

    public Network (boolean debug, String fileName)
    {
        _theNetwork = new Intcode[NETWORK_SIZE];
        _debug = debug;

        for (int i = 0; i < NETWORK_SIZE; i++)
            _theNetwork[i] = new Intcode(IntcodeUtil.readValues(fileName), debug);
    }

    private Intcode[] _theNetwork;
    private boolean _debug;
}
@@ -1,8 +1,29 @@
+import java.util.*;%0A%0A
 // netwo
@@ -368,14 +368,1340 @@
 e), 
-debug)
+%22%22+i, debug);%0A    %7D%0A%0A    public final Packet getFirstPacket (int destination)%0A    %7B%0A        Packet toReturn = null;%0A%0A        do%0A        %7B%0A            for (int i = 0; (i %3C NETWORK_SIZE) && (toReturn == null); i++)%0A            %7B%0A                _theNetwork%5Bi%5D.executeUntilInput();%0A%0A                if (_theNetwork%5Bi%5D.waitingForInput())%0A                %7B%0A                    _theNetwork%5Bi%5D.setInput(Packet.EMPTY_PACKET);%0A                    _theNetwork%5Bi%5D.executeUntilInput();%0A                %7D%0A            %0A                LinkedList%3CString%3E outputs = new LinkedList%3CString%3E(_theNetwork%5Bi%5D.getOutputs());%0A%0A                while (!outputs.isEmpty())%0A                %7B%0A                    Packet thePacket = new Packet(outputs);%0A                %0A                    if (_debug)%0A                        System.out.println(%22Packet received from computer %22+i+%22 is %22+thePacket);%0A%0A                    if (thePacket.getAddress() == destination)%0A                        toReturn = thePacket;%0A                    else%0A                    %7B%0A                        if (thePacket.getAddress() %3C NETWORK_SIZE)%0A                            _theNetwork%5B(int) thePacket.getAddress()%5D.setInputs(%22%22+thePacket.getX(), %22%22+thePacket.getY());%0A                    %7D%0A                %7D%0A            %7D%0A        %7D while (toReturn == null);%0A%0A        return toReturn
 ;%0A  

Update Network.java