adventofcode.sh
Advent of Code 2020 and 2015, done in bash. Because why not? (by einarjon)
aoc2021
My solutions to Advent of Code 2021. (by ritobanrc)
adventofcode.sh | aoc2021 | |
---|---|---|
16 | 13 | |
14 | 0 | |
- | - | |
0.0 | 0.0 | |
about 2 months ago | almost 2 years ago | |
Shell | Rust | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
adventofcode.sh
Posts with mentions or reviews of adventofcode.sh.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-12-05.
-
-🎄- 2022 Day 6 Solutions -🎄-
I have completed years 2015 and 2020 in bash. Gave up halfway through last year, might do that one day. https://github.com/einarjon/adventofcode.sh
- Got answer but want to learn to better optimize for speed (2015, Day 6 Part 2)
- [2021 day 6] What's you're fastest solution?
-
[2015 day 04][Zig] Some tips to solve the problem without brute force?
Python3 is about 25% faster than Python2, with the exact same code. Pypy3 was somewhere in between. https://github.com/einarjon/adventofcode.sh/blob/main/2015/04.sh
-
That took me a while (First part 5 minutes, second part 5+ hours)
Mine is on github too. I think that my worst abuse of grep is this: https://github.com/einarjon/adventofcode.sh/blob/main/19.sh Before the cleanup my part2 regex was around 6-7K chars.
- -🎄- 2021 Day 8 Solutions -🎄-
-
-🎄- 2021 Day 7 Solutions -🎄-
My final script is in my repo, but an earlier commit has this brute force version. https://github.com/einarjon/adventofcode.sh in the 2021 folder.
-
-🎄- 2021 Day 4 Solutions -🎄-
Day 1 was 10 LOC, each day is adding about 10 LOC, so now I'm at 40. I don't like where this is heading. https://github.com/einarjon/adventofcode.sh/blob/main/2021/04.sh Small mistake in Part 2 so it starts the bingo from the beginning, but the first numbers are crossed out. Doesn't affect the result.
-
-🎄- 2021 Day 2 Solutions -🎄-
My solution this year was almost exactly like the one __abigail__ posted. I based it on last year's code for day 12. There are 50 days worth of bash solutions in that repo if you're interested. Some contain Voodoo, but it's mostly readable - I hope...
-
[2020/2015] Finally finished every single one in Bash
I linked to the code. Here it is again. Might be slower in git bash, but works. https://github.com/einarjon/adventofcode.sh/blob/main/13.sh
aoc2021
Posts with mentions or reviews of aoc2021.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-12-10.
-
I learned a bit about Path Finding Algos today
Can confirm, I implemented Djkstra badly (I made it visit every single cell, instead of stopping once it reached the end, since that's what wikipedia did), switched to A* w/o visiting every single cell, got the answer for part 2, and returned to the non-stupid Djkstra and measured -- A* with manhattan distance is about 5ms faster than A* with euclidean distance (since it avoids the square root, and the euclidean distance is actually less appropriate in this situation), and Djkstra beats the Manhattan distance by another 5ms. You can look through all my implementations in the commit history for this file: https://github.com/ritobanrc/aoc2021/blob/main/src/day15.rs
-
-🎄- 2021 Day 11 Solutions -🎄-
Rust, not my proudest code, honestly quite messy, I couldn't decide whether to represent points as Vector2 or usizes into a vector, using both a HashSet for flashed but a Vec for to_flash feels silly, especially since it calls contains on both in the same condition, nor am I proud of the rightward drift resulting in five layers of braces, and the messy conditions on neighbor. But nonetheless, it works, and part 2 was easy enough to hack in on top of part 1, with a couple extra lines (albeit, still a bit messy, with a range 0..usize::MAX since bounded and unbounded ranges are different types, and an unreachable!() in the match statement at the end).
-
-🎄- 2021 Day 10 Solutions -🎄-
Rust. I found today surprisingly easy, much better than the last couple -- part 1 was quite simple, just keep a list of the open ones and close them as necessary. Part 2 should have been trivial to implement on top of that, but I wasn't correctly discarding the corrupted lines, and apparently sorting a list and finding the median without off-by-one errors is hard, so that took a while to debug.
-
-🎄- 2021 Day 8 Solutions -🎄-
Rust -- part 1 was fairly easy, but I had absolutely no clue how to do part 2 for a long time. I ended up just brute forcing it, trying every single possible wire re-arrangement (thanks itertools::permutations). I used a bitmask to represent which lights were on (no idea if its necessary), but it was a fun exercise trying to get the bit fiddling right -- I was pleasantly surprised when it just worked (ig that's the benefit of writing small, fairly self-contained routines). My initial answer for part 2 was also reversed (3535 instead of 5353), which is why there's a rev in there near the end. Overall, very fun challenge -- I enjoyed not knowing how to approach it initially, and I'm sure lots of people will have far more clever solutions.
-
-🎄- 2021 Day 7 Solutions -🎄-
Rust, basic bruteforce solution. Played around with trying to find an analytic solution for a couple mins, but ended up just brute forcing it, and surprisingly, its not absurdly slow.
-
-🎄- 2021 Day 6 Solutions -🎄-
Rust. Unsurprisingly, I did the naive thing for part 1 and then had to re-write for part 2. I'm happy with how clean part 2 is, I just used a Rust array for the counts -- though I'm sure there's a more clean solution for shifting an iterator.
-
Advent of Code rust nuggets
From u/ritobanrc (full solution): use nalgebra::Matrix5 and you can use column_iter() and row_iterator() on your board.
-
-🎄- 2021 Day 4 Solutions -🎄-
Rust -- Happy with how my code turned out for today. I used nalgebra's Matrix5 for storing the boards, which made checking for wins pretty easy.
-
-🎄- 2021 Day 2 Solutions -🎄-
Rust, nothing special here, not particularly fast (I initially thought aim should be a vector and lost some time because of it). The error handling could be a bit cleaner, I might fiddle with that for a bit so I don't have to put .unwraps and .expect and panic! everywhere.
-
-🎄- 2021 Day 1 Solutions -🎄-
Here's my solution without any collects: https://github.com/ritobanrc/aoc2021/blob/main/src/day01.rs -- but I don't think you could do it without itertools, since windows is only implemented for slices, and array_windows for iterators is still unstable (pending const-generics).
What are some alternatives?
When comparing adventofcode.sh and aoc2021 you can also consider the following projects:
AdventOfCode2020 - Solutions to all 25 AoC 2020 problems in Rust :christmas_tree:
AdventOfCode2021 - Solutions to all 25 AoC 2021 problems in Rust :crab: Less than 100 lines per day and under 1 second total execution time! :christmas_tree:
adventofcode
AdventOfCode2021.jl - Advent of Code 2021 in Julia
AOCx2022 - This repository contains my solutions for the Advent of Code 2022 event. Learn more about the event here - https://adventofcode.com/2022/about
aoc2021
advent - Advent Of Code
advent-of-code - https://adventofcode.com/
AdventOfCode
advent-of-code-2021
AdventOfCode - Advent of code
MoreLINQ - Extensions to LINQ to Objects
adventofcode.sh vs AdventOfCode2020
aoc2021 vs AdventOfCode2021
adventofcode.sh vs adventofcode
aoc2021 vs AdventOfCode2021.jl
adventofcode.sh vs AOCx2022
aoc2021 vs aoc2021
adventofcode.sh vs advent
aoc2021 vs advent-of-code
adventofcode.sh vs AdventOfCode
aoc2021 vs advent-of-code-2021
adventofcode.sh vs AdventOfCode
aoc2021 vs MoreLINQ