You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
908 B
Swift

//
// Advent of Code 2018
//
import Foundation
let showTests = true
let onlyOneDay = 0
var allTests: [(() -> ())] = []
var allFinal: [(() -> ())] = []
print("Advent of Code 2018")
// Compile list of Tests
allTests.append(Day01().tests)
allTests.append(Day02().tests)
allTests.append(Day03().tests)
allTests.append(Day04().tests)
allTests.append(Day05().tests)
// Compile list of Answers
allFinal.append(Day01().final)
allFinal.append(Day02().final)
allFinal.append(Day03().final)
allFinal.append(Day04().final)
allFinal.append(Day05().final)
if onlyOneDay > 0 {
print("\nDay \(onlyOneDay)")
allTests[onlyOneDay-1]()
allFinal[onlyOneDay-1]()
} else {
if showTests {
for day in 1...allTests.count {
print("\nDay \(day)")
allTests[day-1]()
}
}
for day in 1...allFinal.count {
print("\nDay \(day)")
allFinal[day-1]()
}
}