<commit_before>/* Boid prototype */

function Boid(ctx) {
    this.x = Math.random() * ctx.canvas.width;
    this.y = Math.random() * ctx.canvas.height;
    this.heading = Math.random() * 2 * Math.PI - Math.PI;
    this.radius = 6;
    this.speed = 2;
    this.radialSpeed = Math.PI / 60;
    this.vision = 50;
}

Boid.prototype.draw = function(ctx) {
    var pointLen = this.radius * 2.5;
    ctx.fillStyle = "blue";
    ctx.beginPath();
    ctx.arc(this.x, this.y, this.radius, 0, 2 * Math.PI);
    ctx.fill();
    ctx.beginPath();
    ctx.moveTo(this.x + Math.cos(this.heading + Math.PI / 2) * this.radius,
               this.y + Math.sin(this.heading + Math.PI / 2) * this.radius);
    ctx.lineTo(this.x + Math.cos(this.heading + Math.PI) * pointLen,
               this.y + Math.sin(this.heading + Math.PI) * pointLen);
    ctx.lineTo(this.x + Math.cos(this.heading - Math.PI / 2) * this.radius,
               this.y + Math.sin(this.heading - Math.PI / 2) * this.radius);
    ctx.fill();
};

Boid.prototype.distance = function(boid) {
    return Math.sqrt((this.x - boid.x) * (this.x - boid.x) +
                     (this.y - boid.y) * (this.y - boid.y));<commit_msg>Move instance variables outside of the constructor.<commit_after>/* Boid prototype */

function Boid(ctx) {
    this.x = Math.random() * ctx.canvas.width;
    this.y = Math.random() * ctx.canvas.height;
    this.heading = Math.random() * 2 * Math.PI - Math.PI;
}

Boid.prototype.radius = 6;
Boid.prototype.speed = 2;
Boid.prototype.radialSpeed = Math.PI / 60;
Boid.prototype.vision = 50;

Boid.prototype.draw = function(ctx) {
    var pointLen = this.radius * 2.5;
    ctx.fillStyle = "blue";
    ctx.beginPath();
    ctx.arc(this.x, this.y, this.radius, 0, 2 * Math.PI);
    ctx.fill();
    ctx.beginPath();
    ctx.moveTo(this.x + Math.cos(this.heading + Math.PI / 2) * this.radius,
               this.y + Math.sin(this.heading + Math.PI / 2) * this.radius);
    ctx.lineTo(this.x + Math.cos(this.heading + Math.PI) * pointLen,
               this.y + Math.sin(this.heading + Math.PI) * pointLen);
    ctx.lineTo(this.x + Math.cos(this.heading - Math.PI / 2) * this.radius,
               this.y + Math.sin(this.heading - Math.PI / 2) * this.radius);
    ctx.fill();
};

Boid.prototype.distance = function(boid) {
    return Math.sqrt((this.x - boid.x) * (this.x - boid.x) +
                     (this.y - boid.y) * (this.y - boid.y));
{'fraction_non_alphanumeric': 0.17695814338997098, 'fraction_numerical': 0.012432656444260257, 'mean_word_length': 2.338865836791148, 'pattern_counts': {'":': 0, '<': 3, '<?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': '386165', 'n_tokens_mistral': 914, 'n_tokens_neox': 883, 'n_words': 169}