generated from eric/adventofcode2023
More template tweaks
This commit is contained in:
@@ -1,12 +1,21 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
|
||||
const inputArray = readFileSync('sample.txt').toString().split("\n");
|
||||
// const inputArray = readFileSync('input.txt').toString().split("\n");
|
||||
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 inputArray) {
|
||||
for (const element of usedArray) {
|
||||
const contents = element.split(" ");
|
||||
|
||||
}
|
||||
@@ -18,11 +27,12 @@ console.log();
|
||||
// Part Two
|
||||
|
||||
console.time("part2");
|
||||
for (const element of inputArray) {
|
||||
for (const element of usedArray) {
|
||||
const contents = element.split(" ");
|
||||
|
||||
}
|
||||
|
||||
console.log();
|
||||
console.timeEnd("part2");
|
||||
console.log();
|
||||
|
||||
// functions
|
||||
|
||||
Reference in New Issue
Block a user