Skip to content

tikitu/advent-of-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My solutions to Advent of Code

Sometimes I solve the puzzles in Advent of Code. When I do they end up here.

2023

Language and packaging: Swift, one Swift Package Manager package with many executable targets.

Reading the code: Advent2023/Sources/ contains the Swift sources. Each day has a subdirectory containing a single Script.swift file.

Running the code: from the top-level Advent2023 directory, cat input/2 | swift run Day04 1 for the first puzzle, Day04 2 for the second.

Getting the input: you'll have to do that yourself. Input is personalised and the author prefers us not to share our input files, to make reverse-engineering the site (slightly) harder. To do it the same way I do, there's a shell function in shell_utils to download the input, inspired by (the much much more feature-full) aoc-cli. To use it you need to grab your session cookie (for the personalised puzzle variant) and set it in an environment variable imaginatively named ADVENT_OF_CODE_SESSION_COOKIE.

2022

Language and packaging: Swift, one Swift Package Manager package with many executable targets.

Reading the code: Advent2022/Sources/ contains the Swift sources. Most days have a subdirectory containing a single Script.swift file. The first few days are combined in Advent2022/Sources/Advent2022/Script.swift (on the third day I created the template).

Running the code: from the top-level Advent2022 directory: cat input | swift run Day04 01 for the first puzzle, Day04 02 for the second.

I understand the author of Advent of Code prefers us not to share our input files, to make it harder to reverse engineer the site (which personalised the puzzle input to some extent). I've tried to avoid committing input files; you can get them yourself.

2021

Language and packaging: Swift, a Swift Package Manager package with one executable target.

Reading the code: it's all in one giant file: Advent2021/Sources/Advent2021/main.swift.

Running the code: from the top-level Advent2021 directory: cat input | swift run Advent2021 <subcommand>. Some days have two subcommands for the two puzzles, some have only one. Use swift run Advent2021 --help to list the subcommands. Some days may not actually produce the answer.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages