22 lines
No EOL
525 B
TypeScript
22 lines
No EOL
525 B
TypeScript
import type { Solvable } from "./solvable.ts";
|
|
|
|
const solutionFiles = Deno.readDirSync('./solutions');
|
|
|
|
const solvables: Solvable[] = [];
|
|
|
|
// need to wrap this stuff in a function to not trip the top level await
|
|
(async () => {
|
|
// cool dynamic module loading
|
|
for (const solution of solutionFiles) {
|
|
await import('./solutions/' + solution.name)
|
|
}
|
|
|
|
// only solve the latest day
|
|
console.log("Solving latest day only:")
|
|
const day = solvables.toReversed()[0];
|
|
day.part1()
|
|
day.part2()
|
|
})()
|
|
|
|
|
|
export { solvables } |