<commit_before>/* for blockly */
var map = null;
var player = null;
function move(code) {
    var index = 0;
    var lines = code.split('\n');
    /* execute line by line */
    var interval = setInterval(tick, 500);
    function tick() {
        if (index == lines.length) clearInterval(interval);
        eval(lines[index++]);
    }
}
function moveForward() {
  map.moveObject(player);
}
function turnLeft() {
  player.turn('left');
}
function turnRight() {
  player.turn('right');
}

(function () {
  'use strict';

  function Map(rows, cols) {
    this.rows = rows || 10;
    this.cols = cols || 10;
    this.container = {};

    /* create the objects matrix */
    this.objects = [];
    for(var i = 0; i < this.rows; i++) {
        this.objects[i] = new Array(this.cols);
    }
    
    /* just for convenience */
    this.players = [];
  }

  Map.prototype.setup = function(jQueryContainerObject) {
    if (arguments.length) {
      this.container = jQueryContainerObject;
    } else {
      console.log('Map.setup(): No object specified.');
    }
  };

  Map.prototype.loadMap = function(fileUrl) {
    console.log(fileUrl);
  };

  Map.prototype.createHtml = function(cols, rows) {
    
    if (arguments.length) {
      this.cols = cols;
      this.rows = rows;
    }

    var tableHtml = '';
    tableHtml += '<table>';

    for (var rowsIter = 0; rowsIter < this.rows; rowsIter++) {<commit_msg>Add ajax map data loading<commit_after>/* for blockly */
var map = null;
var player = null;
function move(code) {
    var index = 0;
    var lines = code.split('\n');
    /* execute line by line */
    var interval = setInterval(tick, 500);
    function tick() {
        if (index == lines.length) clearInterval(interval);
        eval(lines[index++]);
    }
}
function moveForward() {
  map.moveObject(player);
}
function turnLeft() {
  player.turn('left');
}
function turnRight() {
  player.turn('right');
}

(function () {
  'use strict';

  function Map(rows, cols) {
    this.rows = rows || 10;
    this.cols = cols || 10;
    this.container = {};

    /* create the objects matrix */
    this.objects = [];
    for(var i = 0; i < this.rows; i++) {
        this.objects[i] = new Array(this.cols);
    }
    
    /* just for convenience */
    this.players = [];
  }

  Map.prototype.setup = function(jQueryContainerObject) {
    if (arguments.length) {
      this.container = jQueryContainerObject;
    } else {
      console.log('Map.setup(): No object specified.');
    }
  };

  Map.prototype.loadMap = function(fileUrl) {
    console.log(fileUrl);

    $.ajax({
      url : "maps/Level_1.csv",
      dataType: "text",
      success: function (data) {
        console.log('Successfully loaded map');
        console.log(data);
      },
      error: function(jqxhr, status, error) {
        console.log('Error loading map: ' + status + ', ' + error);
      }
    }); // ajax
  };

  Map.prototype.createHtml = function(cols, rows) {
    
    if (arguments.length) {
      this.cols = cols;
      this.rows = rows;
    }

    var tableHtml = '';
    tableHtml += '<table>';

    for (var rowsIter = 0; rowsIter < this.rows; rowsIter++) {
{'fraction_non_alphanumeric': 0.16036837091140044, 'fraction_numerical': 0.006668783740870117, 'mean_word_length': 2.4961154273029966, 'pattern_counts': {'":': 0, '<': 9, '<?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': '460228', 'n_tokens_mistral': 1034, 'n_tokens_neox': 999, 'n_words': 238}