{"size": 668, "ext": "js", "max_stars_repo_path": "src/index.js", "max_stars_repo_name": "oskarer/quadzapjs", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/index.js", "max_issues_repo_name": "oskarer/quadzapjs", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/index.js", "max_forks_repo_name": "oskarer/quadzapjs", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.8333333333, "max_line_length": 58, "alphanum_fraction": 0.6766467066}
var h = require('virtual-dom/h');
var diff = require('virtual-dom/diff');
var patch = require('virtual-dom/patch');
var createElement = require('virtual-dom/create-element');

import Field from './field';
import Player from './player';

const player = new Player();
const field = new Field(null, [player]);
var tree = field.render();
var rootNode = createElement(tree);
document.body.appendChild(rootNode);
// 3: Wire up the update logic
setInterval(function () {
      player.goRight();

      var newTree = field.render();
      var patches = diff(tree, newTree);
      console.log(patches)
      rootNode = patch(rootNode, patches);
      tree = newTree;
}, 1000);
