Using Advent of Code as an excuse to learn some Swift (so the code here won’t be idiomatic, or polished; it’s a repository for exploring and understanding).
main.swift
is configured to run the code for both day one and day two. Can
run a single day by commenting out the unnecessary ones.
Input files are user-specific, so if you’re not me, you’ll need to update the
inputs in the Inputs
directory.
There should be one file per day. They can either be replaced in situ, or the Xcode build settings can be tweaked to specify alternative files.
Day one: 5194970 Day two: Part 1: 11590668 Part2 : 2254
- Using an extension to split an int into an array of digits: from Hacking with Swift