home.social

#adventofcode2022 — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #adventofcode2022, aggregated by home.social.

  1. #AdventOfCode2022

    2022 Day 20: Grove Positioning System
    2022 Day 21: Monkey Math
    2022 Day 22: Monkey Map

    I 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:
    github.com/nharrer/AdventOfCod

    #AdventOfCode #AoC #typescript

  2. @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:

  3. 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 😁

    bielsnohr.github.io/2023/02/18

  4. 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…
  5. 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:

    cohost.org/sol-hsa/post/994951
    #AdventOfCode #AdventOfCode2022 #AoC #programming #puzzle

  6. 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!

  7. @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.

  8. After having spent 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!

  9. 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 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

  10. 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)

  11. 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 :) snap.berkeley.edu/snap/snap.ht


  12. 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]!

  13. 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?

  14. 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'1

    It's over. It's done. Whew!

    Not exactly elegant but it works. I might revisit it at a later time!

    #AdventOfCode #apljk #apl #AdventOfCode2022

  15. of done in : gitlab.com/Taywee/adventofcode

    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:

  16. of done in : gitlab.com/Taywee/adventofcode

    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: docs.rs/pathfinding/latest/pat

    Still took about 10 seconds. I could probably optimize it a lot, but it's done.

    Part 2 was just doing it 3 times.

  17. of done in : gitlab.com/Taywee/adventofcode

    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.

  18. of done in : gitlab.com/Taywee/adventofcode

    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.

  19. of done in : gitlab.com/Taywee/adventofcode

    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.

  20. of done in : gitlab.com/Taywee/adventofcode

    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.

  21. of done in : gitlab.com/Taywee/adventofcode

    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.

  22. of done in : gitlab.com/Taywee/adventofcode

    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.

  23. of done in : gitlab.com/Taywee/adventofcode

    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.

  24. 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.

    #AdventOfCode #AdventOfCode2022 #aoc2022 #aoc

    github.com/JamieB226/aoc2022

  25. of done in : gitlab.com/Taywee/adventofcode

    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.

  26. 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.

    #AdventOfCode

  27. 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 :(


  28. 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 :(

    #AdventOfCode #AdventOfCode2022
    #SnapCloud

  29. 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 :(

    #AdventOfCode #AdventOfCode2022
    #SnapCloud

  30. CW: Advent of code

    I just completed "Distress Signal" - Day 13 - Advent of Code 2022 #AdventOfCode 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: git.k-fortytwo.de/christofstee

    #haskell #earley #adventofcode #adventofcode2022 #coding #code

  31. 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...)

  32. I don't think my code for day 9 of the will win a beauty competition, BUT I saved every position of every knot, just for this .

    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:
    github.com/einGlasRotwein/adve

    PS: This beast takes > 30 min to render.

  33. Done Day 10 of Advent of Code 2022 using @SnapCloud

    It was hard to head around the puzzles
    snap.berkeley.edu/snap/snap.ht

    Need to go back and see if I can finish Day 9 now


  34. @SnapCloud Might rest up attempting part 2 of Day 9 and go back to part 1 of Day 7 :)

  35. 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

    snap.berkeley.edu/snap/snap.ht

  36. 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 :)

    snap.berkeley.edu/snap/snap.ht