AdventOfCode

Files in 2022/ of tip
Login

Files in directory /2022 from the latest check-in


Advent of Code 2022

Ashby's solutions using swift, with each day being built as a small CLI app with two sub-commands for "part1" and "part2".

Shouldn't need anything but modern swift 5.7+ from xcode on Ventura or higher hopefully. Specifically swift --version returns this for me on an M1 Air:

swift-driver version: 1.62.15 Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51)
Target: arm64-apple-macosx13.0

Each days command is scaffolded with:

swift package init --type executable

And can be ran without needing to build the exec with:

swift run day<XX> part-<YYY> input

Where:
- <XX> is the left-zero padded day number
- <YYY> is either one or two

Puzzle inputs are expected to be named input and be a plain text file in ascii encoding. There is a helper utility to download these inputs automatically:

aoc-util download <X>