An open API service indexing awesome lists of open source software.

https://github.com/rene-d/advent-of-rust

solutions of https://adventofcode.com/ in Rust and Python
https://github.com/rene-d/advent-of-rust

advent-of-code advent-of-code-2015 advent-of-code-2016 advent-of-code-2017 advent-of-code-2018 advent-of-code-2019 advent-of-code-2020 advent-of-code-2021 advent-of-code-2022 advent-of-code-2023 advent-of-code-2024 advent-of-code-rust rust

Last synced: 2 months ago
JSON representation

solutions of https://adventofcode.com/ in Rust and Python

Awesome Lists containing this project

README

        

# [Advent of Code](https://adventofcode.com) in Rust 🦀

![Stars: 500](https://img.shields.io/badge/Stars-500⭐-blue)
![Rust: 250](https://img.shields.io/badge/Rust-250-cyan?logo=Rust)
![Python: 123](https://img.shields.io/badge/Python-123-cyan?logo=Python)

Christmas Ferris

*Complete* solutions of [Advent of Code](https://adventofcode.com/) in [Rust](https://www.rust-lang.org), and sometimes in [Python](https://www.python.org/) and other languages 🎄✨.

Made for fun 😎 and to practice Rust. Many thanks to [Eric Wastl](https://twitter.com/ericwastl).

## 2024 (current event) ([Calendar](https://adventofcode.com/2024)) ([Solutions](src/year2015/)) : 50⭐

Puzzle | Stars | Languages
---------------------------------------------------------------------- | ----- | -----------
[Day 1: Historian Hysteria](https://adventofcode.com/2024/day/1) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day1/day1.rs) [![Python](./scripts/assets/python.png)](src/year2024/day1/day1.py) [![C](./scripts/assets/c.png)](src/year2024/day1/day1.c) [![C++](./scripts/assets/cpp.png)](src/year2024/day1/day1.cpp) [![Go](./scripts/assets/go.png)](src/year2024/day1/day1.go) [![Ruby](./scripts/assets/ruby.png)](src/year2024/day1/day1.rb) [![Perl](./scripts/assets/perl.png)](src/year2024/day1/day1.pl) [![Lua](./scripts/assets/lua.png)](src/year2024/day1/day1.lua) [![JS](./scripts/assets/javascript.png)](src/year2024/day1/day1.js) [![Bash](./scripts/assets/bash.png)](src/year2024/day1/day1.sh) [![Swift](./scripts/assets/swift.png)](src/year2024/day1/day1.swift) [![Java](./scripts/assets/java.png)](src/year2024/day1/day1.java) [![C#](./scripts/assets/csharp.png)](src/year2024/day1/day1.cs) [![SQLite](./scripts/assets/sqlite.png)](src/year2024/day1/day1.sql)
[Day 2: Red-Nosed Reports](https://adventofcode.com/2024/day/2) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day2/day2.rs) [![Python](./scripts/assets/python.png)](src/year2024/day2/day2.py) [![Go](./scripts/assets/go.png)](src/year2024/day2/day2.go)
[Day 3: Mull It Over](https://adventofcode.com/2024/day/3) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day3/day3.rs) [![Python](./scripts/assets/python.png)](src/year2024/day3/day3.py) [![Go](./scripts/assets/go.png)](src/year2024/day3/day3.go) [![Perl](./scripts/assets/perl.png)](src/year2024/day3/day3.pl)
[Day 4: Ceres Search](https://adventofcode.com/2024/day/4) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day4/day4.rs) [![Python](./scripts/assets/python.png)](src/year2024/day4/day4.py)
[Day 5: Print Queue](https://adventofcode.com/2024/day/5) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day5/day5.rs)
[Day 6: Guard Gallivant](https://adventofcode.com/2024/day/6) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day6/day6.rs)
[Day 7: Bridge Repair](https://adventofcode.com/2024/day/7) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day7/day7.rs) [![Python](./scripts/assets/python.png)](src/year2024/day7/day7.py) [![Go](./scripts/assets/go.png)](src/year2024/day7/day7.go)
[Day 8: Resonant Collinearity](https://adventofcode.com/2024/day/8) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day8/day8.rs) [![Python](./scripts/assets/python.png)](src/year2024/day8/day8.py)
[Day 9: Disk Fragmenter](https://adventofcode.com/2024/day/9) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day9/day9.rs)
[Day 10: Hoof It](https://adventofcode.com/2024/day/10) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day10/day10.rs)
[Day 11: Plutonian Pebbles](https://adventofcode.com/2024/day/11) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day11/day11.rs) [![Go](./scripts/assets/go.png)](src/year2024/day11/day11.go)
[Day 12: Garden Groups](https://adventofcode.com/2024/day/12) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day12/day12.rs)
[Day 13: Claw Contraption](https://adventofcode.com/2024/day/13) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day13/day13.rs) [![Rust](./scripts/assets/rust.png)](src/year2024/day13_z3/day13_z3.rs) [![Python](./scripts/assets/python.png)](src/year2024/day13_z3/day13.py)
[Day 14: Restroom Redoubt](https://adventofcode.com/2024/day/14) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day14/day14.rs) [![Python](./scripts/assets/python.png)](src/year2024/day14/day14.py) [🎁](src/year2024/day14/README.md)
[Day 15: Warehouse Woes](https://adventofcode.com/2024/day/15) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day15/day15.rs) [🎁](src/year2024/day15/README.md)
[Day 16: Reindeer Maze](https://adventofcode.com/2024/day/16) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day16/day16.rs) [🎁](src/year2024/day16/README.md)
[Day 17: Chronospatial Computer](https://adventofcode.com/2024/day/17) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day17/day17.rs)
[Day 18: RAM Run](https://adventofcode.com/2024/day/18) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day18/day18.rs) [![C++](./scripts/assets/cpp.png)](src/year2024/day18/day18.cpp) [![Go](./scripts/assets/go.png)](src/year2024/day18/day18.go)
[Day 19: Linen Layout](https://adventofcode.com/2024/day/19) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day19/day19.rs)
[Day 20: Race Condition](https://adventofcode.com/2024/day/20) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day20/day20.rs)
[Day 21: Keypad Conundrum](https://adventofcode.com/2024/day/21) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day21/day21.rs)
[Day 22: Monkey Market](https://adventofcode.com/2024/day/22) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day22/day22.rs)
[Day 23: LAN Party](https://adventofcode.com/2024/day/23) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day23/day23.rs) [![Python](./scripts/assets/python.png)](src/year2024/day23/day23.py)
[Day 24: Crossed Wires](https://adventofcode.com/2024/day/24) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day24/day24.rs)
[Day 25: Code Chronicle](https://adventofcode.com/2024/day/25) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day25/day25.rs) [![Python](./scripts/assets/python.png)](src/year2024/day25/day25.py) [![Go](./scripts/assets/go.png)](src/year2024/day25/day25.go)

## All years

Calendar | Solutions | Stars | Rust | Python | 🎁
-------- | --------- | ----- | ---- | ------ | --
[Advent of Code 2024](https://adventofcode.com/2024) | [Solutions](src/year2024/README.md) | 50⭐ | 25 | 10 | 3
[Advent of Code 2023](https://adventofcode.com/2023) | [Solutions](src/year2023/README.md) | 50⭐ | 25 | 11 | 2
[Advent of Code 2022](https://adventofcode.com/2022) | [Solutions](src/year2022/README.md) | 50⭐ | 25 | 18 | 1
[Advent of Code 2021](https://adventofcode.com/2021) | [Solutions](src/year2021/README.md) | 50⭐ | 25 | 12 |
[Advent of Code 2020](https://adventofcode.com/2020) | [Solutions](src/year2020/README.md) | 50⭐ | 25 | 23 |
[Advent of Code 2019](https://adventofcode.com/2019) | [Solutions](src/year2019/README.md) | 50⭐ | 25 | 23 | 2
[Advent of Code 2018](https://adventofcode.com/2018) | [Solutions](src/year2018/README.md) | 50⭐ | 25 | 4 | 1
[Advent of Code 2017](https://adventofcode.com/2017) | [Solutions](src/year2017/README.md) | 50⭐ | 25 | 17 |
[Advent of Code 2016](https://adventofcode.com/2016) | [Solutions](src/year2016/README.md) | 50⭐ | 25 | 0 |
[Advent of Code 2015](https://adventofcode.com/2015) | [Solutions](src/year2015/README.md) | 50⭐ | 25 | 5 | 1

## Bonus 🎁

Year | Count | Days
---- | ----- | --------------------
2024 | 3 | [14](src/year2024/day14/README.md) [15](src/year2024/day15/README.md) [16](src/year2024/day16/README.md)
2023 | 2 | [10](src/year2023/day10/README.md) [14](src/year2023/day14/README.md)
2022 | 1 | [17](src/year2022/day17/README.md)
2019 | 2 | [13](src/year2019/day13/README.md) [15](src/year2019/day15/README.md)
2018 | 1 | [18](src/year2018/day18/README.md)
2015 | 1 | [18](src/year2015/day18/README.md)

## Under the hood 🎄

All solutions are *tested* and *verified* with a lot of puzzle inputs and answers (personal accounts, family accounts, friends' accounts and those found on GitHub). Thus, they can be considered totally generic.

By choice, I use the most recent versions of the languages, and therefore sometimes new paradigms and functionalities, since AoC is an excellent way to practice, explore and learn (while having fun!).

Rust solutions respect `cargo clippy -- -D clippy::all -F clippy::pedantic -F clippy::nursery`, which is a pretty strong hardening (except one `clippy::too_many_lines`).

They also include, for the most part, unit tests taken from the examples of puzzle statements.

On average, with all the inputs I have, 80% of them run in less than 100ms on my Apple Silicon M1, and 95% in less than half a second.