<commit_before>
//TODO remove this copy eventually
var LEFT = new Vector2d(-1, 0);
var RIGHT = new Vector2d(1, 0);
var UP = new Vector2d(0, -1);
var DOWN = new Vector2d(0, 1);

function randomMap(size) {
  var map = [];
  for (var x = 0; x < size.x; x++) {
    map[x] = [];
    for (var y = 0; y < size.y; y++) {
      map[x][y] = getRandomInt(0, 1);
    }
  }
  return map;
}


function World(tileSize) {
  var world = this;
  world.TorusVector2d = function (x, y) {
    var modPos = new Vector2d(x, y)
      .add(world.halfMapSize)
      .mod(world.mapSize)
      .sub(world.mapSize.scale(0.5));
    this.x = modPos.x;
    this.y = modPos.y;
  }
  world.TorusVector2d.fromScalar = function (scalar) {
    return new world.TorusVector2d(scalar, scalar);
  };
  Vector2d.setupPrototype(world.TorusVector2d);

  world.mapSizeTiles = tileSize;
  world.mapSize = world.mapSizeTiles.scale(32);
  world.halfMapSize = world.mapSize.scale(0.5);

  // #TODO there is too much high-level initialization here,
  //   we should probably break this out into a class method

  world.map = randomMap(world.mapSizeTiles);

  world.player = new Character(new world.TorusVector2d(0, 0), RIGHT);

}<commit_msg>removed torus vector for now at least<commit_after>
//TODO remove this copy eventually
var LEFT = new Vector2d(-1, 0);
var RIGHT = new Vector2d(1, 0);
var UP = new Vector2d(0, -1);
var DOWN = new Vector2d(0, 1);

function randomMap(size) {
  var map = [];
  for (var x = 0; x < size.x; x++) {
    map[x] = [];
    for (var y = 0; y < size.y; y++) {
      map[x][y] = getRandomInt(0, 1);
    }
  }
  return map;
}


function World(tileSize) {
  var world = this;

  world.mapSizeTiles = tileSize;
  world.mapSize = world.mapSizeTiles.scale(32);
  world.halfMapSize = world.mapSize.scale(0.5);

  // #TODO there is too much high-level initialization here,
  //   we should probably break this out into a class method

  world.map = randomMap(world.mapSizeTiles);

  world.player = new Character(new Vector2d(0, 0), RIGHT);

}
{'fraction_non_alphanumeric': 0.14540942928039702, 'fraction_numerical': 0.026799007444168736, 'mean_word_length': 3.191268191268191, 'pattern_counts': {'":': 0, '<': 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': '7406394', 'n_tokens_mistral': 778, 'n_tokens_neox': 743, 'n_words': 204}