GithubHelp home page GithubHelp logo

advent-of-code's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.