#adventofcode2022 — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #adventofcode2022, aggregated by home.social.
-
2022 Day 20: Grove Positioning System
2022 Day 21: Monkey Math
2022 Day 22: Monkey MapI did get stuck on day 19 of last year's AoC and never finished the remaining days.
While I am waiting for day 4 of this year, I had a go at days 20 - 22 of last year.
20 and 21 were not that hard.
But part 2 of day 22 was a bit tricky. Took me some time to figure out all the tile jumps and direction changes when crossing the cube edges.The code is not very pretty. And the edge traversal stuff only works for a flattened cube pattern which is the same as my input 🤮.
Code is here:
https://github.com/nharrer/AdventOfCode/blob/main/2022/day22/solve-day22.ts -
@ibboard I'm thinking of going with Python, as I did for the half a dozen exercises from #AdventOfCode2022
It's sort of my comfort language, it seems :blobfoxfloofcofe: -
I wrote this blog post about my #AdventOfCode2022 foray into #FunctionalProgramming using the #Elm 🌳 language and then completely forgot to share it! It was an interesting experience, with the main conclusion that I won't continue using Elm but that I want to keep investigating functional programming patterns and design.
Thoughts welcome 😁
https://bielsnohr.github.io/2023/02/18/elm-advent-of-code-2022.html
-
While I had high hopes for finishing #AdventOfCode2022 I ended up bailing at Day 10. It was just starting to take too long. In the beginning I thought it'd be fun to maybe do it as a #RetroComputer challenge too but wanted to give myself best chance of success. Well @instantiator had the exact same idea using the BBC micro. He details the three weeks it took him to get the Day 11 challenge done. Very interesting. #BASIC instantiator.dev/post/8-bit-su… -
Thought about solving old Advent of Code puzzles, but don't have the motivation? Me too! Here's an idea: let's do one puzzle a week.
Deets:
https://cohost.org/sol-hsa/post/994951-old-advent-of-code-r
#AdventOfCode #AdventOfCode2022 #AoC #programming #puzzle -
Solving #AdventOfCode2022 day 15 in #golang with An Algorithm I Found on the Internet™ runs in 1700ms. Simplified based on the specific case (biggish change) -> 900ms. Split work into goroutines (easy) -> 300ms. Moved array allocation out of loop (easiest) -> 170ms. That'll do!
-
@RonJeffries Did you take a look at #AdventOfCode2022 in #Kotlin ? I’m on day 13 and I am loving a) how natural I am finding it to “think in Kotlin” for the puzzles, and b) how I am discovering language and library features as I go along by trying to solve the puzzles and then simplify them into idiomatic Kotlin. Would love to compare notes.
-
After having spent #AdventOfCode2022 solving problems in C, I definitely feel like I have a much better understanding of the language. It was definitely interesting coding while trying to avoid unsafe functions so as not to pick up bad habits. I still can't believe I implemented a hash table for the first time without too much trouble. Still need to finish the last 9 remaining, but definitely have noticed an improvement since day 1!
-
My To-Do list has grown so much in December, but I haven't actually managed to do anything.
Rough To-Do list for January and February (in no particular order):
1. Spiderfire Rewrite Merge + Lots of Documentation
2. Upgrade to Iced 0.5 for die-yield-calculator
3. Finish Day 21 to 25 of #AdventOfCode2022
4. Try SvelteKit out for https://silicon.redfire.dev/ (Currently using Gatsby)
5. Improve the UI and UX of a (private) GUI software
6. Learn some HDL, either Verilog or (higher-level) Chisel -
Lol #AdventOfCode2022 day 7 has been kicking my butt. Figured out how to do tree recursion in a #Scheme though (apparently you still need to use a loop in your recursive function)
-
Having basically bailed out at day 14, I decided to try and get 1st part of Day 25 and have done it in @SnapCloud - I'm finished now for the year :) https://snap.berkeley.edu/snap/snap.html#present:Username=cymplecy&ProjectName=aoc22Day25&editMode
-
Having basically bailed out at day 14, I decided to try and get 1st part of Day 25 and have done it in @SnapCloud - I'm finished now for the year :) https://snap.berkeley.edu/snap/snap.html#present:Username=cymplecy&ProjectName=aoc22Day25&editMode
-
Having basically bailed out at day 14, I decided to try and get 1st part of Day 25 and have done it in @SnapCloud - I'm finished now for the year :) https://snap.berkeley.edu/snap/snap.html#present:Username=cymplecy&ProjectName=aoc22Day25&editMode
-
Having basically bailed out at day 14, I decided to try and get 1st part of Day 25 and have done it in @SnapCloud - I'm finished now for the year :) https://snap.berkeley.edu/snap/snap.html#present:Username=cymplecy&ProjectName=aoc22Day25&editMode
-
Having basically bailed out at day 14, I decided to try and get 1st part of Day 25 and have done it in @SnapCloud - I'm finished now for the year :) https://snap.berkeley.edu/snap/snap.html#present:Username=cymplecy&ProjectName=aoc22Day25&editMode
-
Only got around to the final day's (easy) problem today...but now wrapped up #AdventOfCode2022. And proud to once again regain standing as one of the #AdventOfCode completionists. Thanks for another great year, @[email protected]!
-
So, say I used #AdventOfCode2022 to get better at #Rust. It worked great, but now I want to go further. What's something I can do with Rust to get to the next step?
-
That's it for Advent of Code gifs from me for this year.
If you want to check them all out, they're all here: https://cohost.org/sol-hsa
#AdventOfCode #AdventOfCode2022 #gif #animation #visualization #motiongraphics #hashtag #wtfbbq -
The final day of #AdventOfCode2022 is here, and we are trying to feed some SNAFU to Bob.
Solution: https://gist.github.com/HappyCerberus/1fe81ac6bb7949b9e29e041e8e2b021b
For a commented solution check, my mailing list https://simontoth.substack.com
-
CW: Advent of Code Day 25 - APL
d←{⌊5÷⍨⍵+⍺}
g←{⍵=0:''⋄r←5|⍵⋄r=3:'=',∇2d⍵⋄r=4:'-',∇1d⍵⋄(⍕r),∇0d⍵}
⌽1↓g+/∊{((⊂'210-='⍳⌽⍵)⌷3-⍳5)×5*⍳⍴⍵}¨⊃⎕NGET'input'1It's over. It's done. Whew!
Not exactly elegant but it works. I might revisit it at a later time!
-
#day25 of #AdventOfCode2022 done in #Rust: https://gitlab.com/Taywee/adventofcode/-/blob/master/2022/src/bin/day25.rs
Parsing SNAFU was pretty simple, but building it was harder. It's been a long time since I worked in number bases, and the negative digits really threw me for a loop. I ended up needing to get some help to figure out the proper way of building my SNAFU numbers, and I think it'll probably still be broken for negatives.
First AoC completion! :partyparrot:
-
#day24 of #AdventOfCode2022 done in #Rust: https://gitlab.com/Taywee/adventofcode/-/blob/master/2022/src/bin/day24.rs
Done just in time. I went with a pretty straightforward A*, but because the accessible tiles change with time, I had each node be the tile's position as well as the entire field state at that point in time. The pathfinding crate is very powerful: https://docs.rs/pathfinding/latest/pathfinding/directed/astar/fn.astar.html
Still took about 10 seconds. I could probably optimize it a lot, but it's done.
Part 2 was just doing it 3 times.
-
#day23 of #AdventOfCode2022 done in #Rust: https://gitlab.com/Taywee/adventofcode/-/blob/master/2022/src/bin/day23.rs
Not a hard one. Part 2 takes over a full second to run, which could be improved a lot, but this was way nicer than day 22.
-
#day22 of #AdventOfCode2022 done in #Rust: https://gitlab.com/Taywee/adventofcode/-/blob/master/2022/src/bin/day22.rs
Part 1 was super easy.
Part 2 was so hard I gave up and hardcoded the cube shape. 14 match cases, and it works on multiple input sizes but not on different shapes. I wanted to actually walk and find the next position, or to fold the cube and link them in a mesh of Rc<RefCell<_>>, but I already put too many hours into this and the idea of keeping track of orientation sounded like a pain.
-
#day21 of #AdventOfCode2022 done in #Rust: https://gitlab.com/Taywee/adventofcode/-/blob/master/2022/src/bin/day21.rs
Part 1 was straightforward: just build a tree and execute it.
I had a solution in mind for part 2 of solving the side of the root tree that I knew, then recursively running down the other side until I get to humn with a solution, but I decided to cheat and just used an equation solver library instead.
-
#day20 of #AdventOfCode2022 done in #Rust: https://gitlab.com/Taywee/adventofcode/-/blob/master/2022/src/bin/day20.rs
This one was shockingly easy, even part 2. The toughest part was trying to figure out a way to keep track of what order to move the numbers in, particularly when there are duplicates. I gave up and just attached the original index to them and scanned each time. Far from perfect, but it got the job done without too much trouble.
-
#day19 of #AdventOfCode2022 done in #Rust: https://gitlab.com/Taywee/adventofcode/-/blob/master/2022/src/bin/day19.rs
Really similar to the elephants and valves one. Just a DFS for the maximum with some optimizations to reduce the search space. Interestingly enough, it runs in 0.33 seconds on my actual input, but takes 15 seconds on the example, which is different from a lot of problems that take way longer on the real input. I think it's because the smaller costs on the example balloon the search space.
-
#day18 of #AdventOfCode2022 done in #Rust: https://gitlab.com/Taywee/adventofcode/-/blob/master/2022/src/bin/day18.rs
Quick and easy one. For part one, just ran from the min to max for all axes in turn, incrementing each time a pair had one droplet and one air voxel. Part 2 was the same, but also with a pathfinding check between the air voxel and a known outside voxel.
Got sick of implementing my own coordinate types and just pulled in nalgebra.
-
#day17 of #AdventOfCode2022 done in #Rust: https://gitlab.com/Taywee/adventofcode/-/blob/master/2022/src/bin/day17.rs
Another very difficult one. Once it occurred to me that there would be probable cycles in the tower, I came upon a solution. It's not the nicest, but it's not too bad either. Some pessimistic input could probably still get the wrong answer, too.
-
Day 10 is done. Not sure I'll catch up by the 24th. Still 8 days back.
-
Day 9 was a pain in the neck mostly because I tried a little too much code reuse from part #1 Still 8 days back.
-
#day16 of #AdventOfCode2022 done in #Rust: https://gitlab.com/Taywee/adventofcode/-/blob/master/2022/src/bin/day16.rs
Oh my god. This problem was challenging and my code is hideous and full of redundancies. I'm not cleaning it up. I'm lucky I finished it at all.
I built my graph by calculating the shortest path between all non-zero valves and then discarding zeros. Then I just traversed with an inexact heuristic.
Part 2 was harder, having to track two routes at the same time. It was an absolute headache.
-
Day 8 wasn't so bad and is done now. Only 8 days back.
-
Day 7 kicked my ass, but it's finally done. Only 9 days back (again).
-
I completed #Day14 of #AdventOfCode2022.
#Medium difficulty, because of the #ASCIIArt (I'm not using libs for that) and of the careful design of the program (to avoid most subtle bugs, thus loss of time). About 5 hours, total, between design, coding, and testing. Tiring, but not tricky.
I really need a good package of #iterable classes and methods; the standard #JavaScript classes are good, but not enough.
-
Well my revised Day 12 failed to complete overnight as well :( Together with failing to even come up with an algorithm for Day 13 - I think this years journey is over for me :(
-
Well my revised Day 12 failed to complete overnight as well :( Together with failing to even come up with an algorithm for Day 13 - I think this years journey is over for me :(
-
Well my revised Day 12 failed to complete overnight as well :( Together with failing to even come up with an algorithm for Day 13 - I think this years journey is over for me :(
-
CW: Advent of code
I just completed "Distress Signal" - Day 13 - Advent of Code 2022 #AdventOfCode https://adventofcode.com/2022/day/13
Today is also the first day, I use external libraries. Using a real parsing library made things so much easier.
Additionally I started an "Aoc" Library of useful Aoc related functions, like `splitOn :: a -> [a] -> [[a]]`, that divides a list by some a.
Code is here: https://git.k-fortytwo.de/christofsteel/aoc2022/-/blob/main/day13.hs
#haskell #earley #adventofcode #adventofcode2022 #coding #code
-
I completed #Day11 of #AdventOfCode2022. It was the hardest of the #AdventOfCode problems, for now: almost 5 hours to solve!
Difficulty: #Medium.
Part 1 was easy-to-medium: code to the specs, take care of the always-mutating array lengths during the loops.
When, at part 2, numbers started overflowing, the difficulty shot up right to Medium: I had to use #BigInt. Then, even it overflowed!
(Spoiler in the reply...)
-
Finished Part 2 of Day 9 using @SnapCloud so I'm up-to-date :)
https://snap.berkeley.edu/snap/snap.html#present:Username=cymplecy&ProjectName=aoc22Day9
-
I don't think my #rstats code for day 9 of the #AdventOfCode2022 will win a beauty competition, BUT I saved every position of every knot, just for this #gganimate.
It's too slow for my taste, but any attempt on speeding it up resulted in too many green dots plotted at the same time (I already struggled to make the gold line stay AND have the right number of green dots appear), or the gold line being wonky.
Find the code here:
https://github.com/einGlasRotwein/advent_of_code_2022PS: This beast takes > 30 min to render.
-
Done Day 10 of Advent of Code 2022 using @SnapCloud
It was hard to head around the puzzles
https://snap.berkeley.edu/snap/snap.html#present:Username=cymplecy&ProjectName=aoc22Day10&editModeNeed to go back and see if I can finish Day 9 now
-
Luckily, part 2 of Day 7 wasn't too hard so I've now got 2 stars for that day as well now :)
https://snap.berkeley.edu/snap/snap.html#present:Username=cymplecy&ProjectName=aoc22Day7&editMode
-
Sucess :) Done Part 1 of Day 7 using @SnapCloud - just took a bit of time off away from trying to do it to get it done :)
https://snap.berkeley.edu/snap/snap.html#present:Username=cymplecy&ProjectName=aoc22Day7&editMode
-
@SnapCloud Might rest up attempting part 2 of Day 9 and go back to part 1 of Day 7 :)
-
Done Part 1 of Day 9 using @SnapCloud but part 2 looks like a major refactorization required!
https://snap.berkeley.edu/snap/snap.html#present:Username=cymplecy&ProjectName=aoc22Day9&editMode
-
Completed Day 8 of Advent of Code 2022 using @SnapCloud - much easier (for me) than yesterdays which I've still not even managed to do part 1
https://snap.berkeley.edu/snap/snap.html#present:Username=cymplecy&ProjectName=aoc22Day8&editMode
-
Luckily did part 1 of Day 6 of Advent of Code 2022 in @SnapCloud using a generic approach otherwise would have had to start again for Part 2 :)
https://snap.berkeley.edu/snap/snap.html#present:Username=cymplecy&ProjectName=aoc22Day6&editMode