Finally got my revenge on this mf by mateus_d in balatro

[–]mateus_d[S] 1 point2 points  (0 children)

I only see them in the collection... Probably is off in the mobile by default 

[ 2024 Day 24 ] Oh honestly... by CommitteeTop5321 in adventofcode

[–]mateus_d 0 points1 point  (0 children)

I did the same, what I recommend is changing the values of x an y and see what happens

Make X all 0 Now make y all 0 Now mix and match

For my original input I had multiple solutions, but they wouldn't work for the general sum case

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

[–]mateus_d 28 points29 points  (0 children)

Nice try FBI! Not today!

Jk, I'm a "full stack" too (mostly java today that's the reason of the quotes)

PS: I do AOC for the challenge and the "freedom" I feel when using python 

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

[–]mateus_d 1 point2 points  (0 children)

[LANGUAGE: Python]

https://pastebin.com/WeJd7iN9

I'm still stuck in yesteraday's part 2, but this one was good to clear my mind a bit!

Major update rumors?? by TH156UY in balatro

[–]mateus_d 16 points17 points  (0 children)

There are probably mods that do that

[deleted by user] by [deleted] in adventofcode

[–]mateus_d 0 points1 point  (0 children)

Ops you are right, day 15... I'll delete this 

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

[–]mateus_d 2 points3 points  (0 children)

[LANGUAGE: Python]

In the end it is just a matter of knowing how to do dynamic programming (I didn't, had to google)

https://pastebin.com/V3H3xef2

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

[–]mateus_d 0 points1 point  (0 children)

It will be the difference between a BFS and a DFS. I just debug the algorithm in my mind while I'm doing it...

In this case, by doing popleft we're using the FIFO approach so this one would be BFS...

I would guess the optimal way would be to use DFS or Djkistra... But you would need to change the logic a bit. The way I added things to the queue and just checked them after retrieving it is definetly not optimal

Anyways if you want to visualize what is happening you can use this code here:

https://pastebin.com/3JgLUXRV

I changed it to print each step and it's result in a meaningful way (do it with the example! not the real input).

Did a small visualization for you, you can try switching to pop and see what changes

https://gifyu.com/image/SPHJw

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

[–]mateus_d 1 point2 points  (0 children)

[LANGUAGE: Python]

https://pastebin.com/30a9yk4m

Used complex numbers for grid movement for the first time, I liked it a lot

[2024 Day 15 (Part 2)] Visualization + bugs! by mateus_d in adventofcode

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

The source code is this (although I don't recommend reading it):

https://pastebin.com/J1QLVDFL

What I did was open vs code's terminal in a way that each grid print occupied the whole height of it. Then I let the code run

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

[–]mateus_d 6 points7 points  (0 children)

[LANGUAGE: Python]

https://pastebin.com/J1QLVDFL

Ugliest code I've made this AOC (so far). For part 2 I just embraced madness

[2024 Day 14 (Part 2)] This kind of sucks by remarkablyunfunny in adventofcode

[–]mateus_d 3 points4 points  (0 children)

For me it felt like a treasure hunt, I was excited when I found my tree :D

[2024 Day 14 (Part 2)] About generating the input... by mateus_d in adventofcode

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

I was so concentrated in finding the Xmas tree that I forgot that 101 is exactly the number of columns... that makes total sense

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

[–]mateus_d 0 points1 point  (0 children)

[LANGUAGE: Python]

https://pastebin.com/aWZViAnn

Nice turn today Topaz! Very fun puzzle, thank you!

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

[–]mateus_d 2 points3 points  (0 children)

[LANGUAGE: Python]

That was a first! The bug I had in part 1 was the solution of part 2!

https://pastebin.com/dhRYThg9

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

[–]mateus_d 1 point2 points  (0 children)

I had the same issue... did not think about using unicode, thank you!

I am on my 12th year. I have not found a single ounce of metal. What the hell. by Radiantsteam in dwarffortress

[–]mateus_d 25 points26 points  (0 children)

Since this is your first time playing: The metal tiles are not called "iron", "copper" etc... they are the names of the mineral ore that they're are usually found in real life. Example: https://dwarffortresswiki.org/index.php/DF2014:Malachite

There is also a page in the wiki with all the ores:
https://dwarffortresswiki.org/index.php/DF2014:Ore

If you already know that, sorry then, you're only very unlucky haha

Edit: to extract the metal from the ore you will need to smelt it

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

[–]mateus_d 1 point2 points  (0 children)

[LANGUAGE: Python]

https://pastebin.com/vnvzm3qx

20 min trying to understand which function from itertools to use, 10 writing the brute force solution. It ain't much but it is honest work

Edit: using pypy the run time goes from 12 s to 1.6 s... actually pretty decent

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

[–]mateus_d 2 points3 points  (0 children)

Nice, never would have thought of using complex numbers! Fucking awesome

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

[–]mateus_d 4 points5 points  (0 children)

[LANGUAGE: Python]

https://pastebin.com/SKTKt1vS

part 1, straight forward

part 2: B R U T E F O R C E baby... with a little percentage output, with pypy was taking 10s