/* Boids flocking simulation */

function Boid (x, y, direction, velocity) {
  this.x = 0;
}


document.addEventListener("DOMContentLoaded", function () {
  window.boids = {


    // BASIC ATTRIBUTES =======================================================

    flock: [],
    canvas: document.getElementById("boids"),
    ctx: document.getElementById("boids").getContext("2d"),

    fps: 15,


    // RENDERING FUNCTIONS ====================================================
    // These functions connect the simulation to the browser


    // Called to update the canvas coordinate system if the canvas size changes
    sizeChanged: function() {
      var width = boids.canvas.offsetWidth,
          height = boids.canvas.offsetHeight;
      boids.canvas.setAttribute("width", width);
      boids.canvas.setAttribute("height", height);
    },


    // Render the simulation on the canvas
    redraw: function() {

    },


    // SIMULATION LOGIC =======================================================


    // Advance the simulation by one step
    step: function() {

    },


    // USER INTERACTION =======================================================

    interacted: function(e) {
      // Position of the mouse in the viewport
      var absx = e.clientX, absy=e.clientY;
    },


    // CONTROL FUNCTIONS ======================================================

    randomize: function () {

    },

    // Begin the loop

    start: function() {
      boids.step();
      boids.redraw();
      setTimeout(function() {
        requestAnimationFrame(boids.start);
      }, 1000 / boids.fps);
    },


    // Initialize and begin

    init: function() {
      this.sizeChanged(); // Calculate sizes
      this.randomize();
      this.start();
    }
  };




  window.addEventListener("resize", boids.sizeChanged);
  document.addEventListener("mousemove", boids.interacted);
  boids.init();

});

@@ -45,50 +45,12 @@
 id (
-x, y, direction, velocity) %7B%0A  this.x = 0;
+) %7B%0A
 %0A%7D%0A%0A
@@ -119,21 +119,21 @@
  window.
-boids
+flock
  = %7B%0A%0A%0A 
@@ -216,21 +216,21 @@
 ==%0A%0A    
-flock
+boids
 : %5B%5D,%0A  
@@ -620,21 +620,21 @@
 width = 
-boids
+flock
 .canvas.
@@ -665,21 +665,21 @@
 eight = 
-boids
+flock
 .canvas.
@@ -690,37 +690,37 @@
 etHeight;%0A      
-boids
+flock
 .canvas.setAttri
@@ -747,21 +747,21 @@
 ;%0A      
-boids
+flock
 .canvas.
@@ -1419,21 +1419,21 @@
 %7B%0A      
-boids
+flock
 .step();
@@ -1439,21 +1439,21 @@
 ;%0A      
-boids
+flock
 .redraw(
@@ -1515,21 +1515,21 @@
 onFrame(
-boids
+flock
 .start);
@@ -1545,21 +1545,21 @@
  1000 / 
-boids
+flock
 .fps);%0A 
@@ -1758,21 +1758,21 @@
 esize%22, 
-boids
+flock
 .sizeCha
@@ -1819,21 +1819,21 @@
 emove%22, 
-boids
+flock
 .interac
@@ -1840,21 +1840,21 @@
 ted);%0A  
-boids
+flock
 .init();

Rename variables (again)