Skip to content

hdyson/AdventOfCode

Repository files navigation

Summary

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).

Usage

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 data files

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.

Sample output

Day one:  5194970
Day two:  Part 1: 11590668 Part2 : 2254

Swift resources

General

  1. Swift getting started guide
  2. The swift book
  3. Semi-official guide to docstrings in swift

Swift linter in XCode:

  1. SwiftLint

References for particular days:

Day 4:

  1. Using an extension to split an int into an array of digits: from Hacking with Swift

Notes for a day

[0/3] Day 5:

Handle input

Opcode 3: copies input to address (both increment instruction pointer by 2 not 4)

Opcode 4: outputs value at address (both increment instruction pointer by 2 not 4)

About

Exploring https://adventofcode.com for 2019 in Swift

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages