<commit_before>const { readFileToArray } = require("./utils");
const _ = require("lodash");
main();

function readLine(line, index) {
  const [x, y] = line.split(",").map(i => Number(i));
  return {
    x: Number(x),
    y: Number(y),
    isInfinite: false,
    id: index,
    area: 0,
    distance: (x1, y1) => Math.abs(x1 - x) + Math.abs(y1 - y)
  };
}

async function main() {
  const points = await readFileToArray("./day6-input.txt", readLine);
  const matrix = Array(400)
    .fill([])
    .map(x => Array(400).fill("."));
  let area = 0;

  for (let x1 = 0; x1 < 400; x1++) {
    for (let y1 = 0; y1 < 400; y1++) {
      if (!points.find(x => x.distance(x1, y1) > 10000)) {
        matrix[x1][y1] = "#";
      }
    }
  }

  for (let x1 = 0; x1 < 400; x1++) {
    for (let y1 = 0; y1 < 400; y1++) {
      if (matrix[x1][y1] === "#") {
        area++;<commit_msg>6b complete!<commit_after>const { readFileToArray } = require("./utils");
const _ = require("lodash");
main();

function readLine(line, index) {
  const [x, y] = line.split(",").map(i => Number(i));
  return {
    x: Number(x),
    y: Number(y),
    isInfinite: false,
    id: index,
    area: 0,
    distance: (x1, y1) => Math.abs(x1 - x) + Math.abs(y1 - y)
  };
}

async function main() {
  const points = await readFileToArray("./day6-input.txt", readLine);
  const matrix = Array(400)
    .fill([])
    .map(x => Array(400).fill("."));
  let area = 0;

  for (let x1 = 0; x1 < 400; x1++) {
    for (let y1 = 0; y1 < 400; y1++) {
      if (points.reduce((acc, p) => acc + p.distance(x1, y1), 0) < 10000) {
        matrix[x1][y1] = "#";
      }
    }
  }

  for (let x1 = 0; x1 < 400; x1++) {
    for (let y1 = 0; y1 < 400; y1++) {
      if (matrix[x1][y1] === "#") {
        area++;
{'fraction_non_alphanumeric': 0.22291904218928163, 'fraction_numerical': 0.06043329532497149, 'mean_word_length': 2.5240963855421685, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '7529539', 'n_tokens_mistral': 772, 'n_tokens_neox': 712, 'n_words': 175}