fix scaffolding, start d3
This commit is contained in:
parent
048cc9d4c2
commit
af91eb4ed5
6 changed files with 61 additions and 22 deletions
18
main.ts
18
main.ts
|
|
@ -1,8 +1,8 @@
|
|||
import type { Solvable } from "./solvable.ts";
|
||||
import { Day } from "./day.ts";
|
||||
|
||||
const solutionFiles = Deno.readDirSync('./solutions');
|
||||
|
||||
const solvables: Solvable[] = [];
|
||||
const days: Day[] = [];
|
||||
|
||||
// need to wrap this stuff in a function to not trip the top level await
|
||||
(async () => {
|
||||
|
|
@ -12,13 +12,21 @@ const solvables: Solvable[] = [];
|
|||
}
|
||||
|
||||
// only solve the latest day
|
||||
const sortedDays = days.sort((dayL: Day, dayR: Day) => {
|
||||
if (dayL.day < dayR.day) {
|
||||
return -1
|
||||
} else if (dayL.day > dayR.day) {
|
||||
return 1
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
})
|
||||
console.log("Solving latest day only:")
|
||||
const day = solvables[0];
|
||||
console.log(day)
|
||||
const day = sortedDays.reverse()[0];
|
||||
|
||||
day.part1()
|
||||
day.part2()
|
||||
})()
|
||||
|
||||
|
||||
export { solvables }
|
||||
export { days as solvables }
|
||||
Loading…
Add table
Add a link
Reference in a new issue