-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
93 lines (91 loc) · 3.94 KB
/
main.js
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
83
84
85
86
87
88
89
90
91
92
93
import { readFile } from './utils/file-reader.js'
import { printSumOfCalibrationValues } from "./tag-1/tag_1-1.js"
import { printRealSumOfCalibrationValues } from "./tag-1/tag_1-2.js"
import { printAmountOfPossibleGames } from "./tag-2/tag_2-1.js"
import { printSumOfPower } from "./tag-2/tag_2-2.js"
import { printSumOfAllPartNumbers } from "./tag-3/tag_3-1.js"
import { printSumOfAlGearRatios } from "./tag-3/tag_3-2.js"
import { printPointsInTotal } from "./tag-4/tag_4-1.js"
import { printAmountOfScratchcardCopies } from "./tag-4/tag_4-2.js"
import { printLowestLocation } from "./tag-5/tag_5-1.js"
import { printLowestLocationFromSeedRanges } from "./tag-5/tag_5-2.js"
import { printNumberOfWaysToBeatRecord } from "./tag-6/tag_6-1.js"
import { printNumberOfWaysToBeatRecordInBigGame } from "./tag-6/tag_6-2.js"
import { printTotalWinningOfCards } from "./tag-7/tag_7-1.js"
import { printTotalWinningOfCardsWithJokers } from "./tag-7/tag_7-2.js"
import { printSumOfExtrapolatedValues } from "./tag-9/tag_9-1.js"
import { printPointFarthestFromStart } from "./tag-10/tag_10-1.js"
import { printSumOfExtrapolatedValuesBackwards } from "./tag-9/tag_9-2.js"
import { printStepsRequiredToZZZ } from "./tag-8/tag_8-1.js"
import { printStepsUntilAllEndsWithZ } from "./tag-8/tag_8-2.js"
import { printSumOfShortestPaths } from "./tag-11/tag_11-1.js"
import { printSumOfShortestPathsExtreme } from "./tag-11/tag_11-2.js"
import { printSumOfHashResults } from "./tag-15/tag_15-1.js"
import {printFocusingPowerOfLensConfiguration} from "./tag-15/tag_15-2.js";
run(15)
function run(day) {
let fileName
switch (day) {
case 1:
fileName = './tag-1/aufgabe.txt'
readFile(fileName, printSumOfCalibrationValues)
readFile(fileName, printRealSumOfCalibrationValues)
break
case 2:
fileName = './tag-2/aufgabe.txt'
readFile(fileName, printAmountOfPossibleGames)
readFile(fileName, printSumOfPower)
break
case 3:
fileName = './tag-3/aufgabe.txt'
readFile(fileName, printSumOfAllPartNumbers)
readFile(fileName, printSumOfAlGearRatios)
break
case 4:
fileName = './tag-4/aufgabe.txt'
readFile(fileName, printPointsInTotal)
readFile(fileName, printAmountOfScratchcardCopies)
break
case 5:
fileName = './tag-5/aufgabe.txt'
readFile(fileName, printLowestLocation)
readFile(fileName, printLowestLocationFromSeedRanges)
break
case 6:
fileName = './tag-6/aufgabe.txt'
readFile(fileName, printNumberOfWaysToBeatRecord)
readFile(fileName, printNumberOfWaysToBeatRecordInBigGame)
break
case 7:
fileName = './tag-7/aufgabe.txt'
readFile(fileName, printTotalWinningOfCards)
readFile(fileName, printTotalWinningOfCardsWithJokers)
break
case 8:
fileName = './tag-8/aufgabe.txt'
readFile(fileName, printStepsRequiredToZZZ)
readFile(fileName, printStepsUntilAllEndsWithZ)
break
case 9:
fileName = './tag-9/aufgabe.txt'
readFile(fileName, printSumOfExtrapolatedValues)
readFile(fileName, printSumOfExtrapolatedValuesBackwards)
break
case 10:
fileName = './tag-10/aufgabe.txt'
readFile(fileName, printPointFarthestFromStart)
break
case 11:
fileName = './tag-11/aufgabe.txt'
readFile(fileName, printSumOfShortestPaths)
readFile(fileName, printSumOfShortestPathsExtreme)
break
case 15:
fileName = './tag-15/aufgabe.txt'
readFile(fileName, printSumOfHashResults)
readFile(fileName, printFocusingPowerOfLensConfiguration)
break
default:
console.log('nothing found for day', day)
}
}