rDrama Advent of Code Day 6 Discussion Thread

Not sure where @RedNose is so I'll just post this. Post ur solutions below or whatever idc

Advent of Code is an annual Christmas themed coding challenge that runs from December 1st until christmas. Each day the coding problems get progressively harder. We have a leaderboard and pretty good turnout, so feel free to hop in at any time and show your stuff!

Whether you have a single line monstrosity or a beautiful phone book sized stack of OOP code, you can export it in a nice little image for sharing at https://carbon.vercel.app

What did you think about today's problem?

https://adventofcode.com/2023

Our Code is 2416137-393b284c (No need to share your profile, you have the option to join anonymously if you don't want us to see your github)

50
Jump in the discussion.

No email address required.

I saw the big numbers and didn't even try bruteforcing, meanwhile sweating over solving shit I haven't looked at in 15 years :marseycry:

Jump in the discussion.

No email address required.

wish i knew what u r-slurs are talking about

i cant do shit outside of a for loop and if/else

Jump in the discussion.

No email address required.

Did you not do quadratics at school? "negative b plus minus square root of b squared minus 4 a c all over 2 a" is seared into my brain for life.

Not that it mattered, you'd spend minutes writing efficient code for a ~2 second perf boost.

Jump in the discussion.

No email address required.

hmm is it even a performance boost tho? I thought computers suck at division. Or u mean like the xtra computation to derive the answer is less than trying to stick with +-*

Jump in the discussion.

No email address required.

They do, but one equation gives you the solution so it's basically instant. Also the division is by -2 which could just be a bit shift. I think even a binary search brute force would be slower (I cba to check).

Jump in the discussion.

No email address required.

hmm here's what im getting seconds:nanoseconds

https://i.rdrama.net/images/170186705140529.webp

idk what thead op's language is tho but id be curious to compare

e: absolute dogshit for the 2nd part lmfao 16 seconds

https://i.rdrama.net/images/1701867298916147.webp

Jump in the discussion.

No email address required.

Have you got time? True execution time of your program is user+sys. I'm getting ~11 thousandths of a second.

https://i.rdrama.net/images/17018676120219805.webp

Jump in the discussion.

No email address required.

holy shit that's fast

i am running this on my phone but i doubt it'd get that fast even on a server

oh heck no

https://i.rdrama.net/images/17018683570944445.webp

what the actual frick I thought you've been literally shitposting

e: ran mine on a $6 server and script executed in 7s which is still pretty bad

ima start trying to do these in C soon as I get the file parsing figured out

Jump in the discussion.

No email address required.

>what the actual fuck I thought you've been literally shitposting

https://tryapl.org

You can run it yourself, just paste these lines 1 at a time:

s←⍎¨r←'7  15   30' '9  40  200'
q←{⌈1E¯10+¯2÷⍨(¯1×⍵)+(*∘0.5)(¯4×⍺)+⍵*2}
×/1+(⊃s)-2×(2∘⊃q¨⊃)s
t d←⍎¨~∘' '¨r ⋄ ⎕←t-1-⍨2×d q t
Jump in the discussion.

No email address required.

neat, I didn't even know about that

https://i.rdrama.net/images/17018679071824281.webp

Jump in the discussion.

No email address required.

I did but I forgot nearly everything I learned because I don't use it :\

On one hand it's a quick study session away from being usable info, but then also a few days of not using it away from forgetting it again.

And I do remember that specifically the forumla itself is seared in there but outside of solving for possibilities for x³ + 2x² + 8x or whatever Idk any practical use

Jump in the discussion.

No email address required.

This shit:

https://i.rdrama.net/images/17018668181268585.webp

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.