<commit_before>//  Flocking system
//  Based on chapter 6 of Nature of Code by <NAME>
//  http://natureofcode.com/book/chapter-6-autonomous-agents/
//
//  Rewritten for PaperJS and optimized by <NAME> - https://reefscape.net


var Flock = Base.extend({
  initialize: function() {
    this.boids = []; // Initialize array to hold the boids
    this.l = 0; // Track the number of boids
  },

  addBoid: function(newBoid) {
    this.l++;
    this.boids.push(newBoid);
  },

  run: function() {
    for (var i = 0; i < this.l; i++) {
      this.boids[i].run(this.boids);  // Passing the entire list of boids to each boid individually
    }
  }
});<commit_msg>send current mouse position to the boids<commit_after>//  Flocking system
//  Based on chapter 6 of Nature of Code by <NAME>
//  http://natureofcode.com/book/chapter-6-autonomous-agents/
//
//  Rewritten for PaperJS and optimized by <NAME> - https://reefscape.net


var Flock = Base.extend({
  initialize: function() {
    this.boids = []; // Initialize array to hold the boids
    this.l = 0; // Track the number of boids
    this.currentMousePos = new Point();
  },

  addBoid: function(newBoid) {
    this.l++;
    this.boids.push(newBoid);
  },

  run: function() {
    for (var i = 0; i < this.l; i++) {
      this.boids[i].run(this.boids, this.currentMousePos);  // Passing the entire list of boids to each boid individually
    }
  },

  updateMouse: function(mousePos) {
    this.currentMousePos = mousePos;
  }
});
{'fraction_non_alphanumeric': 0.14343707713125844, 'fraction_numerical': 0.005412719891745603, 'mean_word_length': 2.802056555269923, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '2235648', 'n_tokens_mistral': 527, 'n_tokens_neox': 497, 'n_words': 144}