generated from eric/adventofcode2023
39 lines
635 B
JavaScript
39 lines
635 B
JavaScript
import { readFileSync } from 'node:fs';
|
|
|
|
let sampleMode = true;
|
|
let usedArray = [];
|
|
|
|
const sampleArray = readFileSync('sample.txt').toString().split("\n");
|
|
const inputArray = readFileSync('input.txt').toString().split("\n");
|
|
|
|
if (sampleMode) {
|
|
usedArray = sampleArray;
|
|
} else {
|
|
usedArray = inputArray;
|
|
}
|
|
|
|
// Part One
|
|
|
|
console.time("part1");
|
|
for (const element of usedArray) {
|
|
const contents = element.split(" ");
|
|
|
|
}
|
|
|
|
console.timeEnd("part1");
|
|
console.log();
|
|
|
|
|
|
// Part Two
|
|
|
|
console.time("part2");
|
|
for (const element of usedArray) {
|
|
const contents = element.split(" ");
|
|
|
|
}
|
|
|
|
console.timeEnd("part2");
|
|
console.log();
|
|
|
|
// functions
|