A template to solve Advent of Code problems using Swift

Overview

Advent Of Code Swift Template

This repository serves as a template for an Xcode project set up to solve the Advent of Code problems in Swift. No attempt is made to automate the fetching of inputs. It's a simple MacOS command line project, meaning there are no resources bundled, so the inputs must be held in a directory and specified with a command line argument.

Command Line Arguments

The command line arguments when running in Xcode can easily be set by going to Product -> Scheme -> Edit Scheme... and clicking on the Arguments tab in the Run configuration.

  • Specify the path to the folder where the inputs can be found by passing in the -i argument. E.g. -i /path/to/inputs. Inputs should be saved in files matching the format day%d_input.txt, for instance day20_input.txt.
  • Specify the day to run using the -d argument. E.g. -d 4. If no specific day is found, all 25 days are run.

Requirements

  • Xcode 13+

Architecture

It's a very simple architecture with a Day protocol adopted by various day classes. Each day has a part1 and a part2 function that take in an input and returns some CustomStringConvertible, meaning you can return an Int, String, Bool, etc. Templates are provided for each day's unit tests as well to test parsing, algorithms, etc.

An example Day1.swift and Day1Tests.swift are provided to solve the 2020 Problem 1

You might also like...
The template for Delta Client plugins.

Delta Plugin Template This repository is a template for Delta Client plugins. To create a plugin, create a repo from this template repo and then repla

React Native Template for Taro

React Native Template for Taro requirement taro: @tarojs/cli@^3.2.0 framework: 'react' quick start install react native library install peerDependenci

Xamoom tourism template iOS

xamoom-tourism-template-iOS Pods Install pods via command pod install Buid system Open File - Workpace settings Select Legacy Build System Check Do n

SwiftUITemplate - Template repository for SwiftUI projects

SwiftUITemplate Template repository for SwiftUI projects. Environment Name Versi

LinkedLog is a Xcode plugin that includes a Xcode PCH header file template that adds the macros `LLog` and `LLogF` and parses their output to link from the console to the corresponding file and line.
LinkedLog is a Xcode plugin that includes a Xcode PCH header file template that adds the macros `LLog` and `LLogF` and parses their output to link from the console to the corresponding file and line.

LinkedLog Xcode Plugin LinkedLog is a Xcode plugin that includes a Xcode PCH file template that adds the macros LLog and LLogF. The LLog macro will wo

The template for SwiftPM-based highly modularized (iOS) applications

basic-ios-template Getting started Fork the repo as a template. Create a local folder for your app and navigate to it mkdir YourAppName cd YourAppN

React Native library that implements PayPal Checkout flow using purely native code (swift).
React Native library that implements PayPal Checkout flow using purely native code (swift).

react-native-paypal-swift React Native library that implements PayPal Checkout flow using purely native code (swift). Installation npm install react-n

Delightful code generation for OpenAPI specs for Swift written in Swift
Delightful code generation for OpenAPI specs for Swift written in Swift

Create API Delightful code generation for OpenAPI specs for Swift written in Swi

WebDomHandling - A Swift Package for handling JavaScript code between WebKit and Swift implemented by WebKit

WebDomHandling A Swift Package for handling JavaScript code between WebKit and S

Owner
Christopher Luu
Christopher Luu
Swift Interview Problems in Playground

SwiftInterviewProblems Two Parts -- Swift Playgrounds & Read Me Swift Interview Problems in Playground you may have to copy and paste the code into a

Zachary Smith 43 Jan 2, 2023
A zero-code template app that demonstrates how to use TheraForge's APIs and can be used for fast prototyping

TheraForge MagicBox 1.0.0-beta The Open TheraForge (OTF) MagicBox app is a template for creating digital health solutions that help people better mana

TheraForge 0 Dec 23, 2021
Template repository for quickly creating boilerplate code for a SwiftUI macOS app.

Sidebar App This is a template repository for quickly creating boilerplate code for a SwiftUI macOS app. License This app is released into the public

apparata 22 Dec 18, 2022
This is a template repository for quickly creating boilerplate code for a SwiftUI macOS menu bar app.

Menu Bar App This is a template repository for quickly creating boilerplate code for a SwiftUI macOS menu bar app. License This app is released into t

apparata 5 Dec 6, 2022
UIKit-based app project template for Swift Playgrounds 4

playgrounds-uikit-app This is a simplistic sample template for Swift Playgrounds 4 to begin with a UIKit-based app delegate & window scene instead of

Steven Troughton-Smith 39 Sep 19, 2022
Use this template as a starting point for any Swift 5 module that you want other people to include in their projects

Swift 5 Module Template Use this template as a starting point for any Swift 5 mo

James Knipe 0 Dec 28, 2021
A template Vapor app with nginx frontend.

This is an example Vapor app. It contains the app itself, as well as surrounding components (Postgres database, nginx frontend for providing secure connection), all runnable out of the box with docker compose. It is a good starting point for Vapor development of an API server which you could access from macOS and iOS clients.

Jaanus Kase 5 Jul 1, 2022
🛠 A flexible and easy template created to speed up the development of your iOS application based on the MVP pattern.

Model-View-Presenter template A flexible and easy template created to speed up the development of your iOS application based on the MVP pattern. This

Tamerlan Satualdypov 22 Nov 9, 2022
XCode Preview template for UIkit based project.

SwiftPreview XCode Preview template for UIkit based project. Support custom file template class inherit from UIView and UIViewController. How to use?

Won Heo 10 Mar 31, 2022
Static Native Template and Dynamic Styling without any other app release

FileManager Project Students and Freshers, Good opportunity for you to learn and contribute in this project. Here you would learn how you can change t

Naveen Chauhan 3 Nov 30, 2021