Swift solutions for Advent of Code 2021

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...
How to use swiftlint to identify unused code or unused imports in a Swift codebase

Swift compilation database This repository demonstrates how to use swiftlint to identify unused code or unused imports in a Swift codebase. How to run

A simple Swift sample code to reads ISO 10303-21 exchange structure (STEP P21) file for AP242 schema.

simpleP21ReadSample A simple sample code to reads ISO 10303-21 exchange structure (STEP P21) file for AP242 schema. by Tsutomu Yoshida, Minokamo Japan

Generate Swift code from Qt5 user interfaces.

Qlift-uic Description qlift-uic takes a Qt5 user interface description file and compiles it to Swift code for use with QLift. Splitted from main QLift

XCSnippetsApp - macOS application to explore code snippets from the Swift and iOS community, view and edit the snippets before adding them conveniently to Xcode
XCSnippetsApp - macOS application to explore code snippets from the Swift and iOS community, view and edit the snippets before adding them conveniently to Xcode

XCSnippetsApp macOS application to explore code snippets from the Swift and iOS community, view and edit the snippets before adding them conveniently

Command line tool for exporting resources and generating code from your Figma files
Command line tool for exporting resources and generating code from your Figma files

Fugen Fugen is a command line tool for exporting resources and generating code from your Figma files. Currently, Fugen supports the following entities

Some code for playing with the Teenage Engineering Ortho Remote

ortho-remote C program for interfacing with the Teenage Engineering Ortho Remote. Currently only implemented for macOS Puts the remote into MIDI mode

The iOS pod which can collect profile data to detect code coverage.
The iOS pod which can collect profile data to detect code coverage.

CodeCoverageKit Installation CodeCoverageKit is available through CocoaPods.

Yumemi Co., Ltd. iOS engineer code check task
Yumemi Co., Ltd. iOS engineer code check task

株式会社ゆめみ iOS エンジニアコードチェック課題 概要 本プロジェクトは株式会社ゆめみ(以下弊社)が、弊社に iOS エンジニアを希望する方に出す課題のベースプロジェクトです。本課題が与えられた方は、下記の概要を詳しく読んだ上で課題を取り組んでください。 アプリ仕様 本アプリは GitHub の

High-quality source code, easy implementation

High-quality source code, easy implementation

Owner
Christopher Luu
Christopher Luu
1st place and Best ML Hack for LEC Hacks 2021

MoreCycle Anish Lakkapragada, Aayush Talluri, Soumik Sinha, and Abhishek Nambiar's project is found here. Idea Often times we don't know whether to re

Anish 6 Feb 11, 2022
SGS Last Punch - SGS 2021 Dev Camp 2nd Team Last Punch

Snack 여러 협업 툴을 사용하면서 새 창을 키거나 알트탭은 그만! Slack과 Notion의 기능을 합친 Snack으로 쾌적한 협업을 경험해

Jihyo Kim 10 Oct 20, 2022
Delightful code generation for OpenAPI specs for Swift written in Swift

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

Alexander Grebenyuk 286 Dec 23, 2022
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

null 0 Jan 23, 2022
A Swift SPM framework for running and managing Lua code from Swift

LuaKit A Swift Package for running and managing Lua code from Swift. Documentation For documentation, add this package as Swift Package Dependency, an

GGorAA 5 Nov 24, 2022
OpenAPI/Swagger 3.0 Parser and Swift code generator

SwagGen SwagGen is a library and command line tool for parsing and generating code for OpenAPI/Swagger 3.0 specs, completely written in Swift. Swagger

Yonas Kolb 568 Jan 5, 2023
The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs!

SwiftGen SwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them ty

null 8.3k Dec 31, 2022
SwiftTypeReader - You can gather type definitions from Swift source code.

SwiftTypeReader - You can gather type definitions from Swift source code.

omochimetaru 23 Dec 12, 2022
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

Tibb 6 Nov 28, 2022
Some helpful swift code snippets

HelpfulSwiftSnippets Some helpful swift code snippets Network Manager - a generic network manager that deals with downloading data from the internet u

null 2 Oct 17, 2021