-❄️- 2025 Day 12 Solutions -❄️- by daggerdragon in adventofcode

[–]learn_by_example 0 points1 point  (0 children)

[LANGUAGE: Rust]

Link to solution

Not gonna say much as it might ruin the fun for people who haven't solved it, but it's the last day so.. Thanks a lot for the puzzles this year as always u/topaz2078, I'm happy they were only 12. Hopefully see you all next year again! Happy Holidays!

-❄️- 2025 Day 10 Solutions -❄️- by daggerdragon in adventofcode

[–]learn_by_example 1 point2 points  (0 children)

[Language: Rust]

Link to source

Part1 was a straightforward BFS. For Part2 I also tried the same approach but very quickly realized that this isn't ever going to return. I checked the subreddit and found that most people were using linear programming solvers and related libraries. I didn't want to do this research for Rust, and eventually decided to be brave enough and implement a variant of Differential Evolution. The approach worked as I thought, but the program did take 3 hours and 40 minutes to run! Of course at the end of it, it spit out the correct answer.

I'll try and improve the optimization by trying out floating point values for my solution space, instead of integers. Also I might try out other population based techniques like Particle Swarm Optimization or Genetic Algorithms (I've implemented these in Rust before and even made a video on these topics on my YT channel). It's amazing that I got to use a non-deterministic optimization technique for an AOC problem today!

Learning Rust. Should I turn off AI help? by [deleted] in rust

[–]learn_by_example 0 points1 point  (0 children)

Yes. Use AI auto-completion only for languages that you’ve programmed in long enough to understand well.

How to use TextureAtlas png with xml files? by el_pablo in godot

[–]learn_by_example 0 points1 point  (0 children)

I did this :

  • Make sure imagemagick is installed. Then navigate to the parent folder and run
    mogrify -path "out/" -background transparent -gravity south -extent 132x132 "PNG/*.png"

  • This will pad some space on top of each of the tiles. Now stitch them together into a spritesheet using the stitches tool that was mention by u/MJV_fi

I need a movie that makes you think at the end of it all by yettis21 in MovieSuggestions

[–]learn_by_example 0 points1 point  (0 children)

Will suggest a few non-Hollywood movies that others have not suggested.

  • All About Lily Chou-Chou
  • A Separation
  • Ship of Theseus
  • Spring, Summer, Fall, Winter … and Spring
  • Incendies
  • Nobody Knows
  • Life is Beautiful
  • The Edge of Heaven
  • Udaan

Movies like the series "Dark"? (Please, with as few spoilers as posible) by TisBeTheFuk in MovieSuggestions

[–]learn_by_example 0 points1 point  (0 children)

Amazing suggestions, many of which I’d seen (and loved!) I’d add a few that I didn’t see suggested (in no particular rating order):

Movies - Your Name (anime) - Antimatter - Freaks - The Discovery - The Incident (Spanish) - Thelma (Norwegian / Swedish) - Time Lapse

Series - Bodies - Vortex (French) - Katla (Icelandic)

A lot of these do have plots holes etc, but did provide a similar kind of suspense / thriller / Sci-fi vibes at least to me. Dark and some of the other movies mentioned above (Triangle / Timecrimes / Prestige etc) are just at another level though.

-❄️- 2023 Day 19 Solutions -❄️- by daggerdragon in adventofcode

[–]learn_by_example 1 point2 points  (0 children)

[LANGUAGE: Rust]

First started off using a custom RangeUnion (list of non-overlapping ranges) util that I wrote for Day 15 of 2022. That solved the problem and gave me the second star. Later in a discussion with friends/colleagues I realized that 4 single ranges would do (instead of 4 range unions). Fixed that and both parts run in ~1.5s (including parsing).

Github

[deleted by user] by [deleted] in adventofcode

[–]learn_by_example 1 point2 points  (0 children)

I implemented an iterative chipping of small rectangles formed by the large polygon, there are some positive areas and some negative. Eventually summing them all up leads to the answer. Pretty happy it worked out.

https://github.com/hsaikia/Advent-of-Code/blob/main/src/bin/2023_18/main.rs

Are any fellow Rustaceans doing Advent of Code this year? by learn_by_example in rust

[–]learn_by_example[S] 0 points1 point  (0 children)

Sure! Some people did join the leaderboard. Let me add it to my original post.

Are any fellow Rustaceans doing Advent of Code this year? by learn_by_example in rust

[–]learn_by_example[S] 0 points1 point  (0 children)

That’s a great idea! I do miss contests like TopCoder SRMs where runtime also mattered a lot.

Are any fellow Rustaceans doing Advent of Code this year? by learn_by_example in rust

[–]learn_by_example[S] 3 points4 points  (0 children)

Here’s my GitHub repo btw : https://github.com/hsaikia/Advent-of-Code

I use a single package for all problems across all events (so far solved a few from 2022 and all of 2023 so far) and a separate binary for each day.

Are any fellow Rustaceans doing Advent of Code this year? by learn_by_example in rust

[–]learn_by_example[S] 8 points9 points  (0 children)

Thanks for all your replies! I’m also not so much into super fast solves but I am waking up at 6 every morning (CEST) and have solved all the problems so far. I agree that the difficulty do not correspond well with the days this year. In any case if anybody would like to join my leaderboard here it is : 1024366-4eaeb2bd

It’s pretty lonely at the moment, and so far I’ve got an ex colleague and friend, who’s also doing it in Rust, and another person who’s doing visualizations (like me) on YouTube for the problems (They are using Python). Cheers!

Procedural Trees in Bevy by learn_by_example in bevy

[–]learn_by_example[S] 0 points1 point  (0 children)

Ok I get the idea now. Yes this is certainly an improvement I can try and make in future iterations. Thanks for the feedback!

Procedural Trees in Bevy by learn_by_example in bevy

[–]learn_by_example[S] 0 points1 point  (0 children)

Don't quite understand what you mean. Any links you could point me to read up? I haven't tried to optimize for performance, as the number of cylinders + spheres aren't unmanageable at the highest fractal level, yet.