-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
22 lines (18 loc) · 750 Bytes
/
index.ts
File metadata and controls
22 lines (18 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import * as helpers from './helpers';
const year = helpers.getEnv.getYear();
console.log(helpers.texts.createASCII(`AoC ${year}`), '\n');
runYear(year);
async function runYear(year: string): Promise<void> {
const days = (await import(`./${year}`)).default;
for (let day in days) {
const data = helpers.fileHandler.getFileInput(
`${String(day).charAt(0).toUpperCase() + String(day).slice(1)}.txt`
);
console.log(`***** ${day[0].toUpperCase() + day.slice(1, 3)} ${day.slice(3)} *****`);
console.log(`Puzzle 1: ${days[day].puzzle1(data)}`);
console.log(`Puzzle 2: ${days[day].puzzle2(data)}\n`);
}
console.log(
`🎄 Wishing you bug-free days and silent nights of code delight! Happy coding and Merry Christmas! 🎅🎁\n`
);
}