-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod.ts
82 lines (78 loc) · 2.25 KB
/
mod.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import { AdventDay } from './core/AdventDay.ts';
import { AdventDay01 } from './day_01/AdventDay01.ts';
import { AdventDay02 } from './day_02/AdventDay02.ts';
import { AdventDay03 } from './day_03/AdventDay03.ts';
import { AdventDay04 } from './day_04/AdventDay04.ts';
import { AdventDay05 } from './day_05/AdventDay05.ts';
import { AdventDay06 } from './day_06/AdventDay06.ts';
import { AdventDay07 } from './day_07/AdventDay07.ts';
import { AdventDay08 } from './day_08/AdventDay08.ts';
import { AdventDay09 } from './day_09/AdventDay09.ts';
import { AdventDay10 } from './day_10/AdventDay10.ts';
import { AdventDay11 } from './day_11/AdventDay11.ts';
import { AdventDay12 } from './day_12/AdventDay12.ts';
import { AdventDay13 } from './day_13/AdventDay13.ts';
import { AdventDay14 } from './day_14/AdventDay14.ts';
const answer = prompt('Select a day to view the solution output! [1-25] ');
if (answer && isNaN(parseInt(answer))) {
console.log('Invalid day selected!');
Deno.exit(1);
}
const day = parseInt(answer!);
if (day < 1 || day > 25) {
console.log('The given day is not within the range of 1-25.');
Deno.exit(1);
}
let adventDay: AdventDay;
switch (day) {
case 1:
adventDay = new AdventDay01();
break;
case 2:
adventDay = new AdventDay02();
break;
case 3:
adventDay = new AdventDay03();
break;
case 4:
adventDay = new AdventDay04();
break;
case 5:
adventDay = new AdventDay05();
break;
case 6:
adventDay = new AdventDay06();
break;
case 7:
adventDay = new AdventDay07();
break;
case 8:
adventDay = new AdventDay08();
break;
case 9:
adventDay = new AdventDay09();
break;
case 10:
adventDay = new AdventDay10();
break;
case 11:
adventDay = new AdventDay11();
break;
case 12:
adventDay = new AdventDay12();
break;
case 13:
adventDay = new AdventDay13();
break;
case 14:
adventDay = new AdventDay14();
break;
default:
console.log('Invalid day selected!');
}
if (adventDay!) {
console.log('Part 1:');
adventDay.part01();
console.log('Part 2:');
adventDay.part02();
}