nesv / advent-of-code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

advent-of-code

My solutions for the Advent of Code puzzles. Some are in Go, and some are in Rust. I also have some smatterings of other languages, like Lua (for no reason other than wanting to have a little fun).

Go solutions

All of the solutions written in Go are expecting to read input from STDIN. So, to run them:

$ go run 2016/01/part1.go < path/to/input.txt

substituting path/to/input.txt to the file holding your personalized input data.

Go: 2022

The 2022 solutions use the embed package to embed the puzzle input into the executable at compile time.

To run the 2022 solutions:

$ go run 2022/01/main.go

Rust solutions

The Rust solutions expect to read puzzle input from a file, whose path is specified as the first, positional argument to the program. To run the Rust solutions:

$ cd <YEAR>
$ cargo run --bin <DD> -- path/to/input.txt

substituting <YEAR> with the event year (e.g. "2020"), and substituting <DD> with the zero-prefixed day (e.g. "02").

About


Languages

Language:Rust 54.7%Language:Go 28.6%Language:Roff 16.0%Language:JavaScript 0.3%Language:Lua 0.2%Language:Python 0.2%