This are my solutions to the Advent Of Code 2022 event. This year I've been playing along with timsearle and Sfrost007, please check out their solutions if you're interested.
This swift package manager project contains my MacOS command line tool, a framework with all of the logic to solve the puzzles and a test framework to validate against the AoC examples that are given in the puzzle descriptions.
The idea is to use the example problems/solutions provided in the puzzles to do TDD, but sometimes there are no examples that allow TDD.
This project requires a config.swift
file to be created. This is the format of the file:
import Foundation
enum Config {
static let year = 2022
// This is the session cookie from your browser after logging in to https://adventofcode.com/
static let session = "[TOKEN]"
}
To run day 1:
- Either create a file called day1.txt with your puzzle input, or add your AoC session cookie to the code and it'll be created automatically
- Then run
swift run AoC 1
in Terminal