init
This commit is contained in:
commit
95c3c6131a
9 changed files with 2101 additions and 0 deletions
21
main.ts
Normal file
21
main.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
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)
|
||||
}
|
||||
|
||||
if (import.meta.main) {
|
||||
// only solve the latest day
|
||||
solvables.toReversed()[0].part1().part2()
|
||||
}
|
||||
})()
|
||||
|
||||
|
||||
export { solvables }
|
||||
Loading…
Add table
Add a link
Reference in a new issue