import java.util.function.IntConsumer;

import java.util.*;

public class GameEngine
{
    public GameEngine (Vector<String> instructions, boolean debug)
    {
        _computer = new Intcode(instructions, INITIAL_INPUT, debug);
        _debug = debug;
    }

    public final boolean playGame ()
    {
        int x = 0;
        int y = 0;
        int id = TileId.EMPTY;

        while (!_computer.hasHalted())
        {
            while (!_computer.hasHalted() && !_computer.hasOutput())
            {
                _computer.singleStepExecution(INITIAL_INPUT);
            }

            if (!_computer.hasHalted())
            {
                x = Integer.parseInt(_computer.getOutput());

                while (!_computer.hasHalted() && !_computer.hasOutput())
                {
                    _computer.singleStepExecution(INITIAL_INPUT);
                }

                if (!_computer.hasHalted())
                {
                    y = Integer.parseInt(_computer.getOutput());

                    while (!_computer.hasHalted() && !_computer.hasOutput())
                    {
                        _computer.singleStepExecution(INITIAL_INPUT);
                    }

                    id = Integer.parseInt(_computer.getOutput());
                }
                else
                {
                    System.out.println("Error - computer halted after outputing x value!");

                    return false;
                }

                System.out.println("**got "+x+" "+y+" "+TileId.idToString(id));
            }
            else
            {
                if (_debug)
                    System.out.println("Computer halted.");

                return true;
            }
        }

        return true;
    }

    private Intcode _computer;
    private boolean _debug;
    private Screen _theScreen;

    private static final int INITIAL_INPUT = 0; // nothing specified in the overview
}
@@ -242,24 +242,65 @@
 ug = debug;%0A
+        _theScreen = new Screen(_debug);%0A
     %7D%0A%0A    p
@@ -1489,32 +1489,66 @@
              %7D%0A%0A
+                //if (_debug)%0A    
                 
@@ -1571,25 +1571,44 @@
 ln(%22
-**got 
+Tile information: %3C
 %22+x+%22
+,
  %22+y+%22
+%3E and
  %22+T
@@ -1842,24 +1842,123 @@
 rue;%0A    %7D%0A%0A
+    public final int getNumberOfBlocks ()%0A    %7B%0A        return _theScreen.numberOfBlocks();%0A    %7D%0A%0A
     private 

Update GameEngine.java