<commit_before>var scene = new THREE.Scene();
var clock = new THREE.Clock();
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );

var renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );

var material = new THREE.MeshPhongMaterial( { color: 0x6F6CC5, specular: 0x555555, shininess: 30, side: THREE.DoubleSide} );
function createGeom(ax, az, bx, bz, cx, cz, ha, hb, hc) {

  return geometry;
}

var tileMap = [
  {x: 0, z: 1, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 1, z: 1, seH: 1, swH: 1, neH: 2.5, nwH: 2},
  {x: 2, z: 1, seH: 2.5, swH: 2, neH: 2.5, nwH: 2.5},
  {x: 2, z: 3, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 0, z: 3, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 1, z: 3, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 1, z: 2, seH: 1, swH: 1, neH: 2, nwH: 1},
  {x: 1, z: 5, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 3, z: 5, seH: 1, swH: 1, neH: 1, nwH: 1}
];

var tiles = [];

function addTile(ax, az, bx, bz, cx, cz, dx, dz, ha, hb, hc, hd) {
  var geometry = new THREE.PlaneGeometry( 5, 5, 1, 1 );
  geometry.vertices[0] = new THREE.Vector3(ax, ha, az);
  geometry.vertices[1] = new THREE.Vector3(bx, hb, bz);
  geometry.vertices[2] = new THREE.Vector3(cx, hc, cz);
  geometry.vertices[3] = new THREE.Vector3(dx, hd, dz);

  tile = new THREE.Mesh(geometry, material);
  tiles.push(tile);

  scene.add(tile);
}

for (var tile in tileMap) {
  var tileDef = tileMap[tile];
  addTile(
    tileDef.x + 0, tileDef.z + 0, // a
    tileDef.x + 0, tileDef.z + 1, // b
    tileDef.x + 1, tileDef.z + 0, // c
    tileDef.x + 1, tileDef.z + 1, // d
    tileDef.seH + 1,
    tileDef.swH + 1,
    tileDef.neH + 1,
    tileDef.nwH + 1
  );
}

camera.position.x = 3;
camera.position.y = 3;
camera.position.z = 5;

var light = new THREE.AmbientLight( 0x404040 ); // soft white light
scene.add( light );

var directionalLight = new THREE.DirectionalLight( 0xffffff, 0.5 );
directionalLight.position.set( 0, 1, 0 );
scene.add( directionalLight );

function render() {
  requestAnimationFrame( render );

  for (var tile in tiles) {
    tiles[tile].rotation.x += 0.01;
    tiles[tile].rotation.y += 0.01;
    tiles[tile].rotation.z += 0.01;
  }

  renderer.render( scene, camera );
}
render();<commit_msg>Add movement and dummy units<commit_after>var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );

var renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );

// Tile/map Management

var tileMap = [
  {x: 0, z: 0, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 0, z: 1, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 0, z: 2, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 0, z: 3, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 0, z: 4, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 1, z: 0, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 1, z: 1, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 1, z: 2, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 1, z: 3, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 1, z: 4, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 2, z: 0, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 2, z: 1, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 2, z: 2, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 2, z: 3, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 2, z: 4, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 3, z: 0, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 3, z: 1, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 3, z: 2, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 3, z: 3, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 3, z: 4, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 4, z: 0, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 4, z: 1, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 4, z: 2, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 4, z: 3, seH: 1, swH: 1, neH: 1, nwH: 1},
  {x: 4, z: 4, seH: 1, swH: 1, neH: 1, nwH: 1}
];

var tiles = [];

function addTile(ax, az, bx, bz, cx, cz, dx, dz, ha, hb, hc, hd) {
  var geometry = new THREE.PlaneGeometry( 5, 5, 1, 1 );
  geometry.vertices[0] = new THREE.Vector3(ax, ha, az);
  geometry.vertices[1] = new THREE.Vector3(bx, hb, bz);
  geometry.vertices[2] = new THREE.Vector3(cx, hc, cz);
  geometry.vertices[3] = new THREE.Vector3(dx, hd, dz);

  var material = new THREE.MeshPhongMaterial( { color: 0x6F6CC5, specular: 0x555555, shininess: 30, side: THREE.DoubleSide} );
  tile = new THREE.Mesh(geometry, material);
  tiles.push(tile);

  scene.add(tile);
}

for (var tile in tileMap) {
  var tileDef = tileMap[tile];
  addTile(
    tileDef.x + 0, tileDef.z + 0, // a
    tileDef.x + 0, tileDef.z + 1, // b
    tileDef.x + 1, tileDef.z + 0, // c
    tileDef.x + 1, tileDef.z + 1, // d
    tileDef.seH + 1,
    tileDef.swH + 1,
    tileDef.neH + 1,
    tileDef.nwH + 1
  );
}

// Unit Management

var units = []

function addUnit(x, z) {
  var geometry = new THREE.BoxGeometry( .5, .5, .5 );
  var material = new THREE.MeshPhongMaterial( { color: 0x00FF00, specular: 0x555555, shininess: 30, side: THREE.DoubleSide} );

  var unit = new THREE.Mesh( geometry, material );
  unit.position.set(x + 0.5, 2.25, z + 0.5);
  unit.targPos = new THREE.Vector3(x + 0.5, 2.25, z + 0.5);
  units.push(unit);

  scene.add(unit);

  return unit;
}

function moveUnit(unit, newX, newZ) {
  unit.targPos.set(newX, 2.25, newZ);
}

var unitA = addUnit(0, 0);
var unitB = addUnit(0, 2);
var unitC = addUnit(0, 4);

moveUnit(unitA, 3, 4);
moveUnit(unitB, 2, 2);
moveUnit(unitC, 4, 3);

// Camera Controls
camera.position.x = -2;
camera.position.y = 5;
camera.position.z = 7;

camera.lookAt(new THREE.Vector3(0, 1, 0));

// Lighting
var light = new THREE.AmbientLight( 0x404040 ); // soft white light
scene.add( light );

var directionalLight = new THREE.DirectionalLight( 0xffffff, 0.5 );
directionalLight.position.set( 0, 1, 0 );
scene.add( directionalLight );

// Rendering & Movement constants
var MOVEMENT_PRECISION = 1;
var MOVEMENT_UNIT = 0.1;

function render() {
  requestAnimationFrame( render );

  for (unit in units) {
    var aUnit = units[unit];
    if (aUnit.position.x.toFixed(MOVEMENT_PRECISION) !== aUnit.targPos.x.toFixed(MOVEMENT_PRECISION)) {
      if (aUnit.position.x < aUnit.targPos.x) {
        aUnit.position.x += MOVEMENT_UNIT;
      } else {
        aUnit.position.x -= MOVEMENT_UNIT;
      }
    }
    if (aUnit.position.y.toFixed(MOVEMENT_PRECISION) !== aUnit.targPos.y.toFixed(MOVEMENT_PRECISION)) {
      if (aUnit.position.y < aUnit.targPos.y) {
        aUnit.position.y += MOVEMENT_UNIT;
      } else {
        aUnit.position.y -= MOVEMENT_UNIT;
      }
    }
    if (aUnit.position.z.toFixed(MOVEMENT_PRECISION) !== aUnit.targPos.z.toFixed(MOVEMENT_PRECISION)) {
      if (aUnit.position.z < aUnit.targPos.z) {
        aUnit.position.z += MOVEMENT_UNIT;
      } else {
        aUnit.position.z -= MOVEMENT_UNIT;
      }
    }
  }

  renderer.render( scene, camera );
}
render();
{'fraction_non_alphanumeric': 0.1863228049840626, 'fraction_numerical': 0.05694001738626485, 'mean_word_length': 3.074970484061393, 'pattern_counts': {'":': 0, '<': 6, '<?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': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5480852', 'n_tokens_mistral': 3482, 'n_tokens_neox': 3096, 'n_words': 888}