<commit_before>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;
        _theScreen = new Screen(_debug);
        _paddlePosition = null;
        _ballPosition = null;
    }

    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;
                }

                if (_debug)
                    System.out.println("Tile information: <"+x+", "+y+"> and "+TileId.idToString(id));

                Tile theTile = new Tile(new Coordinate(x, y), id));

                _theScreen.updateTile(theTile);

                if(theTile.getId() == TileId.BALL)
                    _ballPosition = theTile.getPosition();
                else
                {
                    if (theTile.getId() == TileId.PADDLE)
                        _paddlePosition = theTile.getPosition();
                }
            }
            else
            {
                if (_debug)
                    System.out.println("Computer halted.");

                return true;
            }
        }

        return true;
    }

    public final int getNumberOfBlocks ()
    {
        return _theScreen.numberOfBlocks();
    }

    private Intcode _computer;
    private boolean _debug;
    private Screen _theScreen;
    private Coordinate _paddlePosition;
    private Coordinate _ballPosition;

    private static final int INITIAL_INPUT = 0; // nothing specified in the overview
}<commit_msg>Update GameEngine.java<commit_after>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;
        _theScreen = new Screen(_debug);
        _paddlePosition = null;
        _ballPosition = null;
    }

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

        /*
         * Initialise the screen.
         */

        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;
                }

                if (_debug)
                    System.out.println("Tile information: <"+x+", "+y+"> and "+TileId.idToString(id));

                Tile theTile = new Tile(new Coordinate(x, y), id));

                _theScreen.updateTile(theTile);

                if(theTile.getId() == TileId.BALL)
                    _ballPosition = theTile.getPosition();
                else
                {
                    if (theTile.getId() == TileId.PADDLE)
                        _paddlePosition = theTile.getPosition();
                }
            }
            else
            {
                if (_debug)
                    System.out.println("Computer halted.");

                return true;
            }
        }

        return true;
    }

    public final int getNumberOfBlocks ()
    {
        return _theScreen.numberOfBlocks();
    }

    private Intcode _computer;
    private boolean _debug;
    private Screen _theScreen;
    private Coordinate _paddlePosition;
    private Coordinate _ballPosition;

    private static final int INITIAL_INPUT = 0; // nothing specified in the overview
}
{'fraction_non_alphanumeric': 0.09556002192581765, 'fraction_numerical': 0.0010962908825141605, 'mean_word_length': 1.3768996960486322, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2549206', 'n_tokens_mistral': 1484, 'n_tokens_neox': 1331, 'n_words': 286}