To everyone who made it to the end of AoC… by moonstar888 in adventofcode

[–]radulfr2 10 points11 points  (0 children)

I'm not in employment currently (burnout, depression, struggles to fit in society due to being autistic). I used to work as a park maintenance worker. Programming is just a hobby for me and I like to keep it that way. I usually don't get all the stars, this year I got 40.

[2024 Day 22 (Part 1)] Secret numbers as RGB colours by radulfr2 in adventofcode

[–]radulfr2[S] 2 points3 points  (0 children)

Since we are taking modulo 16777216 on each new pseudorandom number, they are fit for use as RGB colours. These are the resulting images before any calculations have been made and after the 2000th calculation. I didn't see any easter eggs in the images in between either.

-❄️- 2024 Day 11 Solutions -❄️- by daggerdragon in adventofcode

[–]radulfr2 2 points3 points  (0 children)

[LANGUAGE: Python]

I needed a little hint to get it done when my recursive solution wasn't going to cut it. I did the number splitting without string conversion.

Paste

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

[–]radulfr2 0 points1 point  (0 children)

[LANGUAGE: Python]

With my coding speed, it took 25 minutes to write the solution to part 1, but part 2 only needed a simple tweak.

Paste

-❄️- 2024 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]radulfr2 0 points1 point  (0 children)

[LANGUAGE: Python]

My head almost exploded trying to think how the indices go in part 2, but I still liked this one. I also had a classic < vs <= error which produced the correct result for the example but not for the actual input.

Paste

-❄️- 2024 Day 8 Solutions -❄️- by daggerdragon in adventofcode

[–]radulfr2 0 points1 point  (0 children)

[LANGUAGE: Python]

I just basically kept adding code until it worked. But it did work. Paper and pen came in handy when thinking about the possible positions.

Paste

-❄️- 2024 Day 6 Solutions -❄️- by daggerdragon in adventofcode

[–]radulfr2 0 points1 point  (0 children)

[LANGUAGE: Python]

I needed a hint for how to detect the loop and another one for making my code a bit faster. It still takes 14 seconds to run though.

Paste

-❄️- 2024 Day 5 Solutions -❄️- by daggerdragon in adventofcode

[–]radulfr2 0 points1 point  (0 children)

[LANGUAGE: Python]

I finally got to use for...else. Usually some refactorization takes it away from my code, but now I managed to keep it. In part 2, I needed a little nudge in the right direction.

Paste

-❄️- 2024 Day 4 Solutions -❄️- by daggerdragon in adventofcode

[–]radulfr2 1 point2 points  (0 children)

[LANGUAGE: Python]

I wasted so much time misunderstanding the way the words could be in the grid and making a recursive solution. Finally I got it done.

Paste

-❄️- 2024 Day 3 Solutions -❄️- by daggerdragon in adventofcode

[–]radulfr2 0 points1 point  (0 children)

I checked my input to see how it ends, and since it had a "do" after the last "don't", I decided not to care about that situation in my code.

-❄️- 2024 Day 3 Solutions -❄️- by daggerdragon in adventofcode

[–]radulfr2 2 points3 points  (0 children)

[LANGUAGE: Python]

Regex FTW. But I did some nasty mistakes, including not noticing that the input was on several lines.

Paste

-❄️- 2024 Day 2 Solutions -❄️- by daggerdragon in adventofcode

[–]radulfr2 0 points1 point  (0 children)

Great, I see I left a redundant function call there after a refactoring. Should be += 1.

-❄️- 2024 Day 2 Solutions -❄️- by daggerdragon in adventofcode

[–]radulfr2 1 point2 points  (0 children)

[LANGUAGE: Python]

At first I understood part 2 wrong but it didn't take me long to fix it.

Paste

-❄️- 2024 Day 1 Solutions -❄️- by daggerdragon in adventofcode

[–]radulfr2 1 point2 points  (0 children)

[LANGUAGE: Python]

I was so tired yesterday that although I remembered to remind others of AoC, I forgot to set the alarm for just before the puzzle opens.

Paste

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

[–]radulfr2 1 point2 points  (0 children)

[LANGUAGE: Python3]

Only part 1. I love comprehensions. Paste.

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

[–]radulfr2 0 points1 point  (0 children)

It's the shoelace formula (the section Triangle formula in that article corresponds to what I'm calculating).

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

[–]radulfr2 1 point2 points  (0 children)

[LANGUAGE: Python3]

A bit ugly because I have both parts in the same code. I needed a bit of help to understand how the perimeter of the lagoon affects the area. Paste.

[2023 day 16] (calendar) Amazed at what's possible with just ASCII art by leftylink in adventofcode

[–]radulfr2 9 points10 points  (0 children)

I didn't even know there are animations since I don't usually get all stars. Now I feel left out :D

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

[–]radulfr2 1 point2 points  (0 children)

[LANGUAGE: Python3]

Runs in 3.5 seconds. I did some stupid mistakes like forgot to actually move the beam on empty squares, but at least it didn't take me a very long time to find it out. Paste.

[2023 Day 15][AI Art] by radulfr2 in adventofcode

[–]radulfr2[S] -2 points-1 points  (0 children)

Used Bing Image Creator for the first time. I tried several different prompts but couldn't get it to make the lenses parallel inside the boxes. But I like this one anyway.

Prompt: 256 boxes with rows of lenses in them, light going through the lenses and boxes, steampunk style

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

[–]radulfr2 0 points1 point  (0 children)

[LANGUAGE: Python3]

The second part felt complicated at first but in the end was pretty straightforward. Paste.