AdventOfCodeHaskell
solutions to advent of code problems (by c-coward)
aoc2022
Advent of Code 2022 (by ednl)
AdventOfCodeHaskell | aoc2022 | |
---|---|---|
13 | 22 | |
0 | 2 | |
- | - | |
10.0 | 10.0 | |
over 1 year ago | 9 months ago | |
Haskell | C | |
- | 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.
AdventOfCodeHaskell
Posts with mentions or reviews of AdventOfCodeHaskell.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-12-24.
-
-๐- 2022 Day 25 Solutions -๐-
Haskell. I love balanced base systems! Was just telling my less-math inclined partner about them a bit ago :)
-
-๐- 2022 Day 13 Solutions -๐-
Haskell. Implementing nested lists is fun! The parser was surprisingly straightforward (except for an issue where it was expecting an extra newline at the end of my input), and the bulk of the problem was handled by implementing Ord instances for my data types.
-
-๐- 2022 Day 12 Solutions -๐-
Haskell. Recursive BFS in the State monad! Visited positions are marked with a '|' character, since this is 'z' + 2. My part 1 code didn't need too much modification for part 2, I only needed to account for the fact that adjacent 'a's can visit each other on the first step.
-
Advent of Code 2022 day 12
Code. Recursive BFS using the State monad to update grid positions
-
-๐- 2022 Day 10 Solutions -๐-
Haskell. Both parts are one liners, I add a no op before every addx to avoid skipping cycles, and using a 2D point data type (that I custom implemented based on Linear.V2 for named fields) makes handling the data a breeze!
-
[2022 Day 9] Shortest rope with fixed tail
346 for me. would've loved this as a part 3, since my solution adapts to it really well!
-
Did anyone else build a full tree for day 7?
Something that really helped me out was finding a Tree Zipper library! This one doesn't have the best documentation but it was the only one that wanted to compile in my project lol. It does a lot of the heavy lifting of traversing the tree for you, once you figure out how to use it of course. Here's my not very cleaned up code if you wanna see what I did
-
-๐- 2022 Day 9 Solutions -๐-
Haskell. My idea for part 1 was basically "Find all the places the head goes, then follow it with the tail" which ended up working basically for free in part 2, and I chose the lazy implementation of "just compose these functions together manually, its what the language was built for". Definitely going to refactor that part in the morning lol
-
Advent of Code 2022 day 9
Pretty happy with my code, which amounts to a bunch of composed scanls, my part 1 solution gave me part 2 for free! Code
-
Advent of Code 2022 day 8
Code for the day, with parsing and extra utilities located in src/Util/
aoc2022
Posts with mentions or reviews of aoc2022.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-12-26.
-
[2022 Day 9] "Rope Bridge". A particularly efficient implementation idea (for people who understand C++, but applicable to C/Java/Go/Rust as well)
It may be a nifty hash table (no, it is!:)) but the whole program runs about 12x slower on an M1 than my version where I first determine the max dimensions and simply allocate a grid of booleans... So I wonder how much the 8x8 bitset breakup could improve. But bitsets are a C++ feature. In C, like NRK: https://github.com/ednl/aoc2022/blob/main/09.c (my "startstoptimer.c" and .h are in the same repo)
-
[2022 Day 15 (Part 2)] [Python] I wrote a really fast solution for day 15 part 2 (less than 1ms). What do you think of the algorithm I came up with?
I also checked lines but only after doing a rotation by 45 degrees, so the lines are straight. Compiled in C, fastest run time on M1 was 26 ยตs: https://github.com/ednl/aoc2022/blob/main/15.c
-
-๐- 2022 Day 15 Solutions -๐-
Same code but with preprocessed input to make it all fit into memory, runs in 7 ms on an Arduino Uno! https://github.com/ednl/aoc2022/blob/main/aoc22-15/aoc22-15.ino
-
-๐- 2022 Day 13 Solutions -๐-
Complete program runs in 463 ยตs on Apple M1, 2.61 ms on Pi 4. See comments at the top of the source file for how I measured. My comparison function:
- -๐- 2022 Day 12 Solutions -๐-
-
[2022 day 11][C] Benching Monkeys
Not 100% sure this is Upping-The-Ante, maybe just Other. I wanted to share some benchmark results of my solution for today, day 11 with the 10,000 monkeys, and how I got there. I think the easiest way to compare performance is to use the same hardware, and nowadays fairly common & standardised hardware might be the Raspberry Pi 4. Although, you can't buy any for years now... Best score I got when running my solution on my Pi 4 home server is 15.6 ms.
-
-๐- 2022 Day 11 Solutions -๐-
I quickly saw that I could do "item = item modulo (product of all div-test numbers)" but the implementation took me a while in C without queues or circular buffers. But that's all part of the fun for me! I didn't look for further clever optimisations because the compiled program runs in 20 ms on a Raspberry Pi 4. That was fast enough for today, I thought. Source code: https://github.com/ednl/aoc2022/blob/main/11.c
-
-๐- 2022 Day 10 Solutions -๐-
Yay, embedded software engineering!! :) Short, fast & almost no memory needed in C: https://github.com/ednl/aoc2022/blob/main/10.c or the relevant bits:
-
-๐- 2022 Day 9 Solutions -๐-
That's great, but on what hardware? My solution in C runs in 0.8 ms average (0.6 ms minimum) using hyperfine to measure 1000 runs in a Mac Mini M1. Same on a Pi 4 in performance mode: 3.6 - 3.8 ms.
-
-๐- 2022 Day 8 Solutions -๐-
Well, it took me a while to realise that in part 1 you always have to check the whole row or column because a higher tree can come at any point ... And except for skipping the borders, I couldn't come up with any sort of clever optimisation that would help reduce the O(N^2) complexity. It still runs in under 1 ms on a Mac Mini M1 according to hyperfine. Full code 52 lines without space/comments: https://github.com/ednl/aoc2022/blob/main/08.c
What are some alternatives?
When comparing AdventOfCodeHaskell and aoc2022 you can also consider the following projects:
aoc2022
rust-mos - Empowering everyone to build reliable and efficient software.
Advent-of-code - https://adventofcode.com/
AdventOfCode2022
aoc2022
AdventOfCode - My solutions to Advent of Code
advent2022 - Advent of Code 2022
aoc - KlongPy Advent of Code (AoC) solutions
aoc2022
AOC2022 - Advent of Code 2022, solved in Haskell
advent-of-code - Advent of Code solutions
aoc-go - A Golang tool for generating code for Advent of Code
AdventOfCodeHaskell vs aoc2022
aoc2022 vs rust-mos
AdventOfCodeHaskell vs Advent-of-code
aoc2022 vs AdventOfCode2022
AdventOfCodeHaskell vs aoc2022
aoc2022 vs AdventOfCode
AdventOfCodeHaskell vs advent2022
aoc2022 vs aoc
AdventOfCodeHaskell vs aoc2022
aoc2022 vs AOC2022
AdventOfCodeHaskell vs advent-of-code
aoc2022 vs aoc-go