Finished snippets I did for Advent of Code 2021.

Overview

Advent of Code 2021

This repository includes my Go code for the Advent of Code 2021.

If you want to solve the puzzles yourself first, do so, then look for the solution to compare. Do not cheat yourself out of a great time and learning experience by just copying code!

Please keep in mind most of this is hacked together. I don't claim it's perfect code or even in all cases 100% valid/defined/proper code or whatever. It's for fun and it got the job done in a short amount of time. ๐Ÿ˜€

I'll update this repository now and then to include all my solutions whenever I've got time to properly comment and upload it.

This is mostly for those that are curious. If you want to look at the code, experiment with it, change it, etc. be my guest.

Running from command line

For this year I decided to try something new and use Go. We'll see how it goesโ€ฆ

To run the code for any given day, use the following line (replacing 1 with the number of the desired day):

go run ./cmd/day1

As an alternative, you can also compile the executables explicitly, using build rather than run:

go build ./cmd/day1
./day1

Inputs are expected to be in the data sub folder relative to the current working directory.

Running/debugging in VS Code

I'm using Visual Studio Code for writing and debugging. This should work out of the box, if you open the repository directory directly.

You should be able to pick the source code file of any day and simply hit F5 to run/debug it after creating/adjusting your local launch.json configuration file to change the working directory (cwd) to the workspace folder (${workspaceFolder}) as seen in the following example:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Package",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${fileDirname}",
            "cwd": "${workspaceFolder}"
        }
    ]
}
You might also like...
Advent of code 2021 solutions by: me :)

Advent of code 2021 These are my solutions for the advent of code 2021 event. My idea is to solve all the problems in go, but I may use another langua

A little repository for my Advent of Code 2021 solutions in Go

Advent of Code 2021 What's this repo all about? Well, this is a collection of code written in Golang to solve the daily problems presented in Advent o

Advent of Code 2021 solutions using Go 1.18 Generics

advent-of-code-2021 Here are my solutions for Advent of Code 2021. This year, I chose to write my solutions using Go 1.18 with generics (by building t

My solutions for Advent of Code 2021.

My solutions for Advent of Code 2021 in go. The solution and input data (i.e. my custom input data) for day XX is contained in the subdirectory dayXX.

README snippets for Visual Code inspired by readme.so

vscode-readme This was inspired by @katherinepeterson who made the wonderful readme.so! Huge thanks. Configuration Make sure you have quickSuggestions

Code snippets by first time open source contributors

Introduction Golang code snippets by first time open source contributors Rules How to contribute Add a folder and create your desired code snippet fil

A repository of random code snippets used to develop proof of concepts

Oddments Oddments is a repository of random code snippets used to develop proof of concepts for techniques used with the Windows operating system. POC

did:ar | multi-chain DIDs backed by Arweave
did:ar | multi-chain DIDs backed by Arweave

did:ar | multi-chain DIDs backed by Arweave - THIS IS A WIP ABSOLUTELY SHOULD NOT BE USED IN PRODUCTION ___ ___

A tool to quickly dump notes, todos, snippets, ...

brain_dump brain_dump allows to quickly dump notes, todos, snippets, ... in text files using Golang text/template and functions from the Sprig project

Owner
Mario Liebisch
Mario Liebisch
๐ŸŽ„ My code for the Advent of Code of year 2021 in Go.

Advent of Code 2021 This repository contains all code that I wrote for the Advent of Code 2021. This year I chose to try and learn Go. Enjoy! Built wi

Nick van Ravenzwaaij 0 Dec 9, 2021
Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.

Advent of Code 2021 Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved

Kemal Ogun Isik 0 Dec 2, 2021
Zach Howell 0 Jan 4, 2022
Advent of Code 2021 Solutions

Advent of Code 2021 Solutions for the 2021 Advent of Code Building This project makes use of Go 1.17. go mod download go test ./... Running the Soluti

Nathan Lowe 7 Jan 7, 2022
Advent of Code 2021 - Time to learn Go

aoc2021 Advent of Code 2021 - Time to learn Go Will contain my solutions for aoc2021, so avoid reading the files in .src/aoc2021/ unless you want spoi

null 1 Dec 22, 2021
Advent of Code 2021, experiment in learning Go

aoc_2021 Advent of Code 2021, experiment in learning Go To run, open a terminal in the root folder of the project and run with go run . <day to run> <

Jonathan den Herder 1 Mar 1, 2022
Advent of Code 2021, this time in Go

Go Lang Notes Advent of Code Day 3 The distinction between chars and bytes is a bit annoying. I got tripped up by doing: int(str[pos]) which gives yo

Dan Vanderkam 15 Apr 14, 2022
My solutions for 2021's Advent of Code

Advent of Code 2021 These are my solutions to this year's Advent of Code. I used it as an excuse to practice with a language which I'm not yet very fa

Merlijn Visser 1 Dec 27, 2021
Advent of Code 2021 (Go)

Advent of Code 2021 (Go) This project includes an implementation of the Advent of Code 2021 problems, implemented in Go. These are ports from my C# so

Brad Wilson 1 Dec 18, 2021
Solutions to Advent-of-Code 2021, in Go.

?? advent-of-code-2021 ?? Solutions to 2021 Advent of code. Summary Advent of Code is an annual advent-calendar of programming puzzles. Here are my 20

James Cockbain 2 Jan 3, 2022