<commit_before>'use strict';

var BACKGROUND_COLOR = '#a8d44a';
var SELECTED_COLOR = '#70961f';
var SUGGESTED_COLOR = '#95b650';
var BORDER = '#bce369';

var ocargo = ocargo || {};

ocargo.MapEditor = function() {
    this.submittedPoints = [];
    this.map = initialiseVisited();
    this.grid = initialiseVisited();
    this.current = [];
    this.possibleNext = [];
    this.json = {};
    this.elements = 1;
};

ocargo.MapEditor.prototype.createGrid = function(paper) {
    for (var i = 0; i < GRID_WIDTH; i++) {
        for (var j = 0; j < GRID_HEIGHT; j++) {
            var x = i * GRID_SPACE_SIZE;
            var y = j * GRID_SPACE_SIZE;
            var segment = paper.rect(x, y, GRID_SPACE_SIZE, GRID_SPACE_SIZE);
            segment.attr({stroke: BORDER, fill: BACKGROUND_COLOR, "fill-opacity": 0});

            segment.node.onclick = function () {
                var this_rect = segment;
                return function () {
                    var getBBox = this_rect.getBBox();
                    var point = [getBBox.x / 100, getBBox.y / 100];
                    if(ocargo.mapEditor.map[point[0]][point[1]] === undefined) {
                        ocargo.mapEditor.markPossible(point);<commit_msg>Fixed level_editor.js by re-adding function removed from map.js with 9fa3aa7<commit_after>'use strict';

var BACKGROUND_COLOR = '#a8d44a';
var SELECTED_COLOR = '#70961f';
var SUGGESTED_COLOR = '#95b650';
var BORDER = '#bce369';

var ocargo = ocargo || {};

function pushInstruction(json, coord, instruction) {
    var x = coord.x.toString();
    var y = coord.y.toString();
    if (!json.hasOwnProperty(x)) {
        json[x] = {};
    }
    json[x][y] = instruction;
}

ocargo.MapEditor = function() {
    this.submittedPoints = [];
    this.map = initialiseVisited();
    this.grid = initialiseVisited();
    this.current = [];
    this.possibleNext = [];
    this.json = {};
    this.elements = 1;
};

ocargo.MapEditor.prototype.createGrid = function(paper) {
    for (var i = 0; i < GRID_WIDTH; i++) {
        for (var j = 0; j < GRID_HEIGHT; j++) {
            var x = i * GRID_SPACE_SIZE;
            var y = j * GRID_SPACE_SIZE;
            var segment = paper.rect(x, y, GRID_SPACE_SIZE, GRID_SPACE_SIZE);
            segment.attr({stroke: BORDER, fill: BACKGROUND_COLOR, "fill-opacity": 0});

            segment.node.onclick = function () {
                var this_rect = segment;
                return function () {
                    var getBBox = this_rect.getBBox();
                    var point = [getBBox.x / 100, getBBox.y / 100];
                    if(ocargo.mapEditor.map[point[0]][point[1]] === undefined) {
                        ocargo.mapEditor.markPossible(point);
{'fraction_non_alphanumeric': 0.14132841328413284, 'fraction_numerical': 0.021771217712177122, 'mean_word_length': 2.302070645554202, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 3, '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': '7230568', 'n_tokens_mistral': 932, 'n_tokens_neox': 870, 'n_words': 191}