function bresenhamLine( canvas, p0, p1, color ) {

  var dx = p1[0] - p0[0];
  var dy = p1[1] - p0[1];
  var dydx = dy / dx;
  var dxdy = dx / dy;

  // this check causes us to draw alo9ng the least-degenerate case
  if ( Math.abs(dx) >= Math.abs(dy) ) {
    for ( var i = 0; i < Math.abs(dx); i++ ) {
      // this handles case where points are in inconvenient order
      if ( dx > 0 ) {
        var tx = i  + p0[0];
        var ty = i*dydx + p0[1];
      } else {
        var tx = -i  + p0[0];
        var ty = -i*dydx + p0[1];
      }
      canvas.putPixel( color, tx, ty );
    }
  } else {
    for ( var i = 0; i < Math.abs(dy); i++ ) {
      // inconvenient check as in above
      if ( dy > 0 ) {
        var tx = i*dxdy  + p0[0];
        var ty = i + p0[1];
      } else {
        var tx = -i*dxdy  + p0[0];
        var ty = -i + p0[1];
      }
      canvas.putPixel( color, tx, ty );
    }
  }
  var color = [0,0,255,255];
  canvas.putPixel( color, p0[0], p0[1] );
  canvas.putPixel( color, p1[0], p1[1] );
}

console.log("Loaded bresenham line drawing.");

@@ -901,121 +901,8 @@
   %7D%0A
-  var color = %5B0,0,255,255%5D;%0A  canvas.putPixel( color, p0%5B0%5D, p0%5B1%5D );%0A  canvas.putPixel( color, p1%5B0%5D, p1%5B1%5D );%0A
 %7D%0A%0Ac

Remove debug points.