<commit_before>var world = require('./world');

var display;
var tc, tlcount, brcount, tickNum;
var outputleft, ouputright;
var inputleft, inputright;
var sourceSupplied, gameWorld, winner;

function init(options) {
    display = options.display;
    tc = options.tc;
    tlcount = options.tlcount;
    brcount = options.brcount;
    tickNum = options.tickNum;
    outputleft = options.outputleft;
    outputright = options.ouputright;
    inputleft = options.inputleft;
    inputright = options.inputright;
    sourceSupplied = options.sourceSupplied;
    gameWorld = options.gameWorld;
    winner = options.winner;
}

function pause() {
    var imageTag = document.querySelector("#play-pause > img");
    if (paused) {
        if (winner != 0) {
            return;
        }
        imageTag.setAttribute("src", "pause.png");
        imageTag.setAttribute("alt", "pause");
        paused = false;
        if (!sourceSupplied) {
            gameWorld.setSources(inputleft.getValue(), inputright.getValue());
            sourceSupplied = true;
        }
        run();
    } else {
        paused = true;
        imageTag.setAttribute("src", "play.png");
        imageTag.setAttribute("alt", "play");
    }
}

function restart() {
    winner = 0;
    sourceSupplied = false;
    gameWorld = new world.World();
    paused = true;
    tickNum = 0;
    tc.textContent = "Tick Number " + tickNum;
    tlcount.textContent = gameWorld.map.getSugar('tl');
    brcount.textContent = gameWorld.map.getSugar('br');<commit_msg>World vs world<commit_after>var World = require('./world');

var display;
var tc, tlcount, brcount, tickNum;
var outputleft, ouputright;
var inputleft, inputright;
var sourceSupplied, gameWorld, winner;

function init(options) {
    display = options.display;
    tc = options.tc;
    tlcount = options.tlcount;
    brcount = options.brcount;
    tickNum = options.tickNum;
    outputleft = options.outputleft;
    outputright = options.ouputright;
    inputleft = options.inputleft;
    inputright = options.inputright;
    sourceSupplied = options.sourceSupplied;
    gameWorld = options.gameWorld;
    winner = options.winner;
}

function pause() {
    var imageTag = document.querySelector("#play-pause > img");
    if (paused) {
        if (winner != 0) {
            return;
        }
        imageTag.setAttribute("src", "pause.png");
        imageTag.setAttribute("alt", "pause");
        paused = false;
        if (!sourceSupplied) {
            gameWorld.setSources(inputleft.getValue(), inputright.getValue());
            sourceSupplied = true;
        }
        run();
    } else {
        paused = true;
        imageTag.setAttribute("src", "play.png");
        imageTag.setAttribute("alt", "play");
    }
}

function restart() {
    winner = 0;
    sourceSupplied = false;
    gameWorld = new World.World();
    paused = true;
    tickNum = 0;
    tc.textContent = "Tick Number " + tickNum;
    tlcount.textContent = gameWorld.map.getSugar('tl');
    brcount.textContent = gameWorld.map.getSugar('br');
{'fraction_non_alphanumeric': 0.12718286655683692, 'fraction_numerical': 0.0019769357495881385, 'mean_word_length': 2.809284818067754, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1014824', 'n_tokens_mistral': 913, 'n_tokens_neox': 924, 'n_words': 199}