[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: JZ0Qf.jpg (283 KB, 1014x731)
283 KB
283 KB JPG
VSYNC edition

>Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other.
https://adventofcode.com/

/g/ leaderboard join code:
796940-44255af5
anonymous-only leaderboard:
383378-dd1e2041

previous thread: >>103515171
>>
File: aoc2024day14Clojure.jpg (236 KB, 1016x445)
236 KB
236 KB JPG
>>
Bleh, working out if the antinodes are out of bounds is harder than I thought.
Do I have to build a data structure for this? I hope not. There should be a simpler way.
>>
What's the most efficient way to measure randomness of a sparse matrix? Convolution is the obvious process but it'd involve way too many set lookups. We want as few reads as possible.
>>
>>103521643
>#???
#30
>>
>>103521725
wtf are you talking about
>>
>>103521739
I literally just used the metric Eric gave us in part 1.
>>
>>103521748
day 8. Have you forgotten already? Do you even remember that we went back in time?
>>
File: filtered.mp4 (1.7 MB, 720x720)
1.7 MB
1.7 MB MP4
Ask not for whom the filter bell tolls; it tolls for thee.
>>
File: day8map.png (15 KB, 578x237)
15 KB
15 KB PNG
>>103521748
My map is just sitting in memory like this. On pathfinding problems I can just look for 0A and memory bounds for going out of bounds, but not for placing antinodes because they can be multiple "levels" above or below.
I think I have an idea now, though.
>>
>>103521739
build two matrices at the same time: one for continued steps at the real dimensions, and one with reduced dimensions and deliberate collisions. Make a decision based on how severe the collisions are.
>>
>>103521739
If you're talking about part 2, I just kept all updated positions in an X vector and Y vector, then ran steps until the rolling variance of those jumped significantly. I did a hardcode analytically, but probably could have automated it by checking the stddev too.
>>
>>103521739
Count of points that border a point to the right
Single linear scan, only an and and an add for each point
>>
>>103521739
tree = lowest mean of standard deviation of distances
>>
>>103521810
The slope of a line can be calculated by rise/run ;)
>>
How difficult would it be to find a drone arrangement with false positives? One pic is easy, you make the art and give each pixel a random velocity. What if you wanted to make a bunch of not-tree shapes?
>>
>>103521867
Quite easy unless you want each picture to have a clear border with no errant dots inside it.
>>
Tonight's puzzle will not be hard, but it will be lengthy.
>>
>write a quadrant function for finding 'safety rating' (aka the distribution of bots)
>p2 is about the distribution of bots
>the amount of people that did shit like count swarm size or chinese whateverthefuck
I didn't like this puzzle because it was so open ended but holy shit guys
>>
File: aoc2024day8.jpg (225 KB, 1080x661)
225 KB
225 KB JPG
>>103521725
>is the y or x coordinate of the index negative or larger than the input is tall/wide, repectively?
don't see what's hard about it
>>
I'm tired bros
AOC is the same every year
He should have started inviting guest puzzle writers
>>
>>103522048
this is most probably the last AoC
enjoy it for what it is
>>
>>103522048
Yeah, I’m thinking you’re filtered.
>>
>>103522069
speculation but possible
>>
>>103521966
just like my penis
>>
Oh and to anyone else doing the weekly leetcode competition in 7 minutes? Stay frosty out there boys
>>
>>103522027
>>is the y or x coordinate
That sounds like something I would need to build a data structure to find out.
>>
>>103522128
dictionary/hashmap with tuples of (x,y) as the key is the most comfy for grid problems
>>
>>103522182
certified comf
>>
>>103522182
So I have to implement a hashmap?
That sounds like more work than necessary.
>>
>>103522242
try not using a memelang next time
>>
>>103522242
If you have the memory, a 2d array works well.
>>
>>103522182
Unironically why I like using awk. Hashmap is the only data structure available.

(I use tuples of (row, col) though.)
>>
>>103522242
the coordinate space is tiny. Your hashmap can have a hash function of identity.
Also, implement one. Very simple hashmaps are easy and still useful and performant.
>>
>>103522259
What's the fun in THAT?
>>
File: sparse_dict.png (245 KB, 853x429)
245 KB
245 KB PNG
>>103521725
the simplest way is to use a something like a default dictionary as a sparse data-structure, and then stop worrying about writing out of bounds. at the end of your computation just query the range you're interested in.

picrel, it's in my own autism lang but you get the idea
>>
>>103521725
>working out if the antinodes are out of bounds is harder than I thought.
It's literally isOutOfBoungs(x, y, limit) => x < 0 || y < 0 || x > limit || y > limit

I have no idea what you could you possibly be having a hard time with.
>>
>>103521725
well you see, you have a maximum x and a maximum y, and if your point has coordinates bigger than that it's out of bounds. Hope this Helps!!!!!!
>>
>>103522646
In awk, checking the value of a cell instantiates it and populates it with a null string, which is then returned.

I always fuck up at least one day for an embarrassingly long time because of this fun little behavior.
>>
>>103521801
lmao
>>
>>103522069
why do you say that
>>
>>103522889
10th AOC
eric has given up
>>
As long as you guys refresh your knowledge of push-relabel algorithms, you’ll have no problem tackling tonight’s puzzle.
>>
>>103522069
I am also getting this feeling. I'm scared bros...
>>
File: aoc_2024_14.png (73 KB, 592x1256)
73 KB
73 KB PNG
Perl. Just looking for a straight vertical grouping of finger-in-the-sky length under and assumption that trees are usually tall.
Picture puzzles are fun.
>>
1 HOUR anon, where are you? Is everything ok?
>>
>>103522918
I’m sure AoC will continue even if Eric does stop, but I fear it’ll become overtly political (leftist) if he turns it over to his reddit moderators.
>>
This can all be done by solving linear congruences with the extended Euclidean algorithm. No grid or simulation is necessary. Height and width are both prime, so each bot will cycle through every x coordinate every "width" seconds, and every y coordinate every "height" seconds.
For each pair of bots (a,b), with x-positions p_x_a, p_x_b and x-velocities v_x_a and v_x_b, compute the next time they share an x coordinate by solving t*(v_x_b-v_x_a)-(p_x_a-p_x_b)=0 mod width. Do the same with the y coordinates.
Time t_x is the time with the most pairs of bots sharing x coordinates, which repeats every "width" seconds, and time t_y is the time with the most pairs of bots sharing y coordinates, which repeats every "height" seconds. Then the answer is the first point at which these cycles coincide, so where t mod width == t_x and t mod height == t_y, which is again just a linear congruence to solve.
>>
>>103522069
>>103522918
I think two things cause this feeling: LLM's are obviously the big one, since they make coding skill feel less rarified/valued/impressive, but the web boom finally being over somehow also makes the whole thing seem more... trivial.

I've been doing this for 10 years now, and it really does feel like the world has moved on from coding as The Smart People Thing™
>>
>>103522957
Field too long, so here's my implementation. Imported the functions from sympy for conciseness, but they're pretty trivial to write yourself if you want to.
from collections import defaultdict
from functools import reduce
from itertools import combinations
from operator import mul
import re
from sympy import mod_inverse
from sympy.ntheory.modular import solve_congruence

W = 101
H = 103
N = 100

quadrants = [0, 0, 0, 0]
points = []
for l in open("input.txt").read().splitlines():
p_x, p_y, v_x, v_y = (
int(n) for n in re.search(r"(-?\d+),(-?\d+) v=(-?\d+),(-?\d+)", l).groups()
)
points.append([p_x, p_y, v_x, v_y])
p_x, p_y = (p_x + v_x * N) % W, (p_y + v_y * N) % H
quadrants[0] += p_x < W // 2 and p_y < H // 2
quadrants[1] += p_x < W // 2 and p_y > H // 2
quadrants[2] += p_x > W // 2 and p_y < H // 2
quadrants[3] += p_x > W // 2 and p_y > H // 2
print(reduce(mul, quadrants))

x_intersection_times, y_intersection_times = defaultdict(int), defaultdict(int)
for (pxa, pya, vxa, vya), (pxb, pyb, vxb, vyb) in combinations(points, 2):
if (vxa - vxb) % W != 0:
x_intersection_times[((pxb - pxa) * mod_inverse(vxa - vxb, W)) % W] += 1
if (vya - vyb) % H != 0:
y_intersection_times[((pyb - pya) * mod_inverse(vya - vyb, H)) % H] += 1
best_time_x = max(x_intersection_times.items(), key=lambda i: i[1])[0]
best_time_y = max(y_intersection_times.items(), key=lambda i: i[1])[0]
print(solve_congruence((best_time_x, W), (best_time_y, H))[0])
>>
>>103522943
It is in a very precarious position. I have a hard time describing why I like AoC, it is a combination of many factors. Even the smallest change could cause me to group it with with leetcode slop and lose interest.
>>
>>103522960
>make coding skill feel less rarified/valued/impressive, but the web boom finally being over somehow also makes the whole thing seem more... trivial.
Wtf are you talking about. This is a huge red flag for being a normgroid. I would work on that.
>>
>>103522975
I’ve never participated in leetcode, but I’ve only ever heard it discussed as a pejorative. Project euler on the other hand is quite excellent.
>>
>>103522975
>I have a hard time describing why I like AoC
It's because you're given a file and total creative freedom about how to reach the answer and what extra constraints you want to add. This engenders a sense of ownership/inefficiency that allows for the human experience in a way filling in a function header on LeetCode doesn't.
>>
>>103522986
leetcode is unironically too easy
>>
>>103522988
This is definitely a huge reason, if not the entire reason.
>>
File: day8silver.png (43 KB, 828x680)
43 KB
43 KB PNG
Everything is fine.
>>
>>103522992
Ah ok. PE is quite simple for most of the first 100 problems. It requires “special knowledge” (number theory) as you progress further.
>>
>>103523003
Do you solve these puzzles in another language at midnight, or just GBA?
>>
>>103522968
And this could be made constant in the number of bots by sampling a fixed number of them, regardless of how many there are, since we're given that "most" of the robots are part of the pattern.
>>
>>103522940
replaced with clock
>>
>>103523004
Leetcode is just "do you know basic CS topic x and recognize that it applies to this problem" where x is dynamic programming, finding strongly connected components, radix sort, or whatever. The implementations are always trivial and the math never gets very deep.
>>
>>103523011
Yes, I have solved them already in python.
Sometimes the solutions just don't translate well across, though. Like with day 7.
In python I was just carrying forward and pruning, but I checked and I would have needed more than 2MB of memory to do that on GBA, which has like 288kB total available, so it had to be a completely different approach.
>>
File: F1m2pE5aQAARFUV.jpg (36 KB, 500x500)
36 KB
36 KB JPG
>>103522069
>>103522093
>>103522894
>>103522918
>>103522943
If any of this is true, I just want you guys to know that it's been an incredible honor spending my last 10 Christmases with you all.

If anyone's interested in some sort of more permanent way to stay in touch, I'm really considering it.
>>
>>103523113
sure add me on linkedin https://www.linkedin.com/in/kadenbilyeu
>>
>>103523113
If it really is the last one. Ill be here in /aocg/ december first next year. I wont be the only one.
>>
>>103522957
Or you can look for minimum standard deviation and solve a system of two lin. cong. and hardcode that 51 is the inverse of 101 modulo 103 and vica versa to make it even faster >>103517593
>>
>>103523185
My way is log(max(R,C)) though
>>
>>103522960
> the world has moved on from coding as The Smart People Thing

Sort of. It's Cybersecurity and AI now, which are at least coding adjacent.
I just got out of college and the amount of times I've seen people unironically have stuff like "Cybersecurity is my passion" in their bio's is truly embarrassing.
>>
Is the krita draw anon still with us? did he make a drawing for day 14? I might have missed it.
>>
>>103523113
You can find me on /g/, I'm stuck here forever apparently otherwise I'd have left long ago.
>>
>>103523219
he should draw an elf historian who really needs to use the bathroom but can't because of the patrolling robots haha that would be really funny I think hahaha
>>
>>103523003
basedboy!
>>
T MINUS 24 MINUTES UNTIL FILTER IGNITION...
>>
"find the christmas tree" is kino because I actually had to think about a solution

it wasn't
>just do what eric says, word for word
or
>just use an algorithm someone else invented, word for word

it was
>figure it out on your own
>try anything you want
>if it doesn't work, try something else
>you will know for certain when you've found it
and that's based
not only that, there were multiple ways you could do it
>check for first frame no robots overlap
>check for a high density
>check for multiple robots in a line
>notice suspicious patterns every 101 and 103 frames and use CRT to get the frame where they collide
>print out every single frame and check those
you had to be creative, you had to try something new, you had to experiment and observe
it was an actual puzzle
it was kino
>>
File: Fv06qWvXgAI81nu.jpg (352 KB, 979x2175)
352 KB
352 KB JPG
>>103523212
As someone who genuinely does enjoy cybersecurity, these people have been a plague for decades.

>>103523122
>>103523170
>>103523221
Good to know we'll all still be here.
>>
>>103523226
haha yeh. Lets hope he sees this suggestion.
>>
>day 15
>first two weeks done
the great filter begins NOW
>>
>>103523219
No, but he's skipped days before and drawn double days, i wouldn't panick (yet)
>>
>>103522960
>The Smart People Thing™
Become a mathbro, we've been looking good for 4000 years. In all honesty my interest in programming shifted more towards electronics.
>>
> hands status: washed

I am ready
>>
>>103523287
Electronics programming is really fun. I was thinking of doing some memesolves on a microcontroller with visualizations on a connected screen, but I have no resolve.
>>
>programming skill status: washed

I am ready (to be filtered)
>>
>>103522975
A lot of people have tried to copy AoC, but the ones I have tried (advent of cyber, advent of SQL) just don't even come close imo. They don't have the secret sauce.
>>
>>103523253
Well, it is a good puzzle, but it is not a good AoC puzzle. Correct me if I am wrong, but there was zero puzzle like this so far.
>>
>>103523113
>some sort of more permanent way to stay in touch

For me it's on /g/. Just not in those AI slop generals. Why are there so many of them anyway? Do we really need DALL-E general, local diffusion general, AND stable diffusion general? I'm tired of having to hide them. They should really get their own containment board.
>>
>>103523308
i dont think i'd have any interest in AOC without these threads, the shitposting about the puzzles every day along with the knowledge that youre doing it together with others here is like 80% of the fun
the >reddit is an abysmal shithole
>>
spoilers: another easy day today
>>
>>103523305
FPGA programming is exceedingly fun. My interest in electronics was primarily motivated to study electronics warfare.
>>
File: filtered.jpg (126 KB, 864x676)
126 KB
126 KB JPG
>>103523315
It's not hard anon
>>
>>103523305
Never understood the appeal desu
Way more interesting programming modern CPUs and GPUs precisely because they're so complex, and using that complexity to reach the limit of their incredible performance potential is a lot more satisfying than programming for something so limited
>>
where is everybody???
>>
>>103523327
Yeah, the hard days are specifically for Sunday night/Monday mornings.
>>
File: showtime.jpg (46 KB, 640x480)
46 KB
46 KB JPG
https://www.youtube.com/watch?v=hjGZLnja1o8
>>
>>103523353
cancer music
>>
Good morning Good evening Saars
>>
>>103523351
But why.. everyone has to go to work on monday
>>
>>103523353
kino music
>>
>>103522940
was sleeping
just barely made it in time
>>
File: file.png (119 KB, 498x498)
119 KB
119 KB PNG
>>103523350
Everyone's filtered. It's over.
>>
>>103523353
You know, I've never listened to the cancer music.
Let's see how bad it is.
>>
File: mokou-showtime.jpg (130 KB, 440x518)
130 KB
130 KB JPG
>>
>>103515403
yeah, worked pretty quick. If it didn't work, I'd just try something similar but less extreme, or entropy checking.
>>
>>103523353
kino music
>>
>>103523350
im here
>>
>>103523353
SHOWTIME
>>
djikstra time
>>
>>103523353
ONE TWO SEVEN THREE
>>
>>103523365
you had to be around 2012 when nightcore was a thing
good times
>>
>>103523377
boring
>>
File: 1733201676061642.png (453 KB, 1858x1829)
453 KB
453 KB PNG
SHOWTIME
>>
File: 1702712550229751.jpg (122 KB, 960x540)
122 KB
122 KB JPG
Tonight's the night!
>>
WHAT ARE THE PARTY CINDERELLAS?
>>
interpreter/assembly/reverse engineering problem tonight
>>
>>103523253
If you like solving ill-defined problems you will love when you find an acutal job.
>>
brootbros we can do it
>>
File: file.png (433 KB, 383x681)
433 KB
433 KB PNG
>ass: unwashed
>force: brooted
Showtime.
>>
>>103523388
exciting
>>
game simulation with resources, DP to minimize moves
>>
>>103523392
good morning
>>
time to broot
>>
intcode if dubs
>>
>>103523387
here
>>
i unironically need to shit. its over.
>>
>>103523399
uh oh
>>
FUCK
>>
FUCK
>>
FUCK
>>
FUCK
>>
advent of parsing
>>
>>103523399
FUCK
>>
FUCK
>>
>maze
see you in 3 hours
>>
>>103522960
eric doesn't care about llm's so get that idea out of your prepubescent head
>>
congratulations tree-haters, you get all details this time. Happy?
>>
jblow in shambles
>>
> first gold star took 15 minutes
i'm nervous bros
>>
>part 2
fuck this is annoying
>>
>part 2
FFS
>>
part 2 is just to consider a ton of annoying edge cases or am I missing something?
>>
>The larger example
where is it though???
>>
>>103523570
it's the large example for p1
>>
File: xarbon.png (27 KB, 500x1508)
27 KB
27 KB PNG
unwashed ass
      -------Part 1--------   -------Part 2--------
Day Time Rank Score Time Rank Score
15 00:14:21 400 0 00:39:48 322 0
>>
Yea i'm not bothering with this physics simulation crap for now.
>>
>part 2
ah yes, the eric special
>>
......[]
.....[].
....[]..
...[]...
..[]....
.[].....
[]......

nah, I'm good bro. I'll take the filtered on this one
>>
>p2
I just don't want to
>>
Day       Time  Rank  Score       Time  Rank  Score
15 00:15:10 468 0 00:46:16 586 0

got everything working then spent 10 minutes debugging pt2 because my GPS coordinates were off by 1
>>
edgecase bros
############
# @ #
# [] #
# [] #
# [] #
# [] #
# [] #
# [][] #
# [] [] #
# [] [] #
# [] # #
# #
############
>>
>>103523634
is not that hard anon
>>
File: file.png (7 KB, 205x459)
7 KB
7 KB PNG
>dont know why its not working
i tested some weird edge cases and it looks fine
>>
File: carbon(11).png (789 KB, 1786x6110)
789 KB
789 KB PNG
unwashed js ass
will repost washed with a cute 2hu later

      --------Part 1---------   --------Part 2--------
Day Time Rank Score Time Rank Score
15 00:18:42 786 0 00:55:30 908 0
>>
>>103523678
>cute
hang yourself, you'll never fit in
>>
>part 2
I can't solve this tired, good night bros
>>
File: robit.gif (462 KB, 150x150)
462 KB
462 KB GIF
D : <
>>103523682
same
>>
>>103523681
you think anime girls arent cute or you think touhou girls arent cute?

cope?
>>
>>103523676
Have you walked through the example step by step?
>>
>>103523687
the small one yes
the big one its so fucking long and keeps doing pointless moves back and forth, i looked at part of it and it looked fine
>>
>>103523686
>touhou
I have no fucking idea what that is and don't even care
anime girls are not cute but rather aesthetically pleasing.
>>
>>103523695
youre clueless and youre splitting hairs
the worst combo
>>
>>103523695
>am i fitting in bros
>btw whats touhou
newfag
>>
just got p2. I think it was fun to figure out a way to implement it
>>
File: file.png (19 KB, 227x791)
19 KB
19 KB PNG
hmm...
>>
>>103523711
jewgled it and some niggerlicious video game
gaymers should hang
>>
>>103523720
you're not supposed to stack the boxes, that's how you get a stack overflow
>>
I did part 1 with no notion of boxes, just swapping spots in the grid. I dont think this will work for p2, i feel like I need to use a dict in some way
>>
>>103523694
>now it gets the right answer for example but not real one
AAAAAAAAAAAAA
>>
>>103523729
you can do it recursively
>make backup of grid
>star recursive push (return success / error)
>if error, revert from backup
>>
how are niggers getting filtered on this, literally just a dfs but control in which direction it can spread
>>
File: carbon.png (466 KB, 997x3155)
466 KB
466 KB PNG
>>103523728
had a hearty kek
Apparently there was a small bug in my wall handling code, I fixed it and everything worked.
This is some messy unwashed ass today.
      -------Part 1--------   -------Part 2--------
Day Time Rank Score Time Rank Score
15 00:37:25 2981 0 01:10:42 1436 0
>>
File: file.png (6 KB, 132x469)
6 KB
6 KB PNG
>>103523738
aha im somehow sometimes overwriting walls
>>
>>103523752
it's not in their algos textbook they have memorized
>>
>works on the example
>too low on the input
Every time!
>>
File: file.png (739 KB, 2388x2952)
739 KB
739 KB PNG
>>103523759
that fixed it
      -------Part 1--------   -------Part 2--------
Day Time Rank Score Time Rank Score
15 00:16:08 555 0 01:16:28 1649 0

surprised the ranking isnt worse
>>
>>103523758
>1h, filtered
>>
Part 2 is also tedious as fuck. I have no desire to work on this right now.
>>
File: carbon.png (734 KB, 1498x3584)
734 KB
734 KB PNG
Glad we're done with high school algebra, moving boxes is more my speed.
      --------Part 1--------   --------Part 2--------
Day Time Rank Score Time Rank Score
15 00:24:54 1527 0 01:04:57 1245 0

Fun day, took me a bit long to iron out the part 1 bugs, I used the wrong dist/dir name basically everywhere and had to debug with test cases. Glad the logic held in both parts, just so many typos...
I did the first part with a while loop and the second part recursively.
>>103523678
18 minutes sub 1k, that's a bit surprising.
>>
>>103523665
This shouldn't be a problem if you maintain a set of the "pushing front".
>>
>part 2 works on every example but not full input
kill me
>>
>>103523787
You and me both, friend.
>>
File: mecha cirno.png (567 KB, 750x714)
567 KB
567 KB PNG
What if the touhouh is also a robot?
>>103523781
>me no smart, me get filtered
>>
File: carbon(59).png (1.04 MB, 1514x5562)
1.04 MB
1.04 MB PNG
adapt, improvise, and overcome
      --------Part 1--------   --------Part 2--------
Day Time Rank Score Time Rank Score
15 00:36:35 2860 0 01:19:43 1764 0
>>
>>103523795
>>>/v/
>>
>I pulled a wall towards me
I dont even know how the fuck i managed this. how am I THIS bad at recursion holy fuck
>>
>>103523811
>redefining a function in an else statement
does this tank your performance or does it not matter
>>
>>103522128
all you need is a 2D array
>>
>>103522720
why would you do that instead of just checking if the cel number is outside the bounds
>>
>example works
>input doesn't
I've been skipping through my frames for minutes now and I can't find anything obviously wrong.
>>
>>103523821
i don't know. writing multi line lambdas to enable code-reuse inside a function is a habit from C++
>>
>>103523833
try some of these

############
#..@.......#
#..[]......#
#...[].....#
#....[]....#
#.....[]...#
#....[]....#
#...[][]...#
#..[]..[]..#
#.[]....[].#
#..[]...#..#
#..........#
############

############
#..@.......#
#..[]......#
#...[].....#
#....[]....#
#.....[]...#
#....[]....#
#...[][]...#
#..[]..[]..#
#.[]....[].#
#..[]..#...#
#..........#
############

####################
##................##
##................##
##..[][][][][]....##
##...[][][][].....##
##....[][][]......##
##.....[][].......##
##......[]........##
##......@.........##
####################
>>
DONE
that was awful I took way longer than I should've
but at least I'm done
>>
right answer on all inputs wrong solution imma kms
>>
File: 1721735764901884.png (615 KB, 1376x6084)
615 KB
615 KB PNG
thanks numpy
      --------Part 1--------   --------Part 2--------
Day Time Rank Score Time Rank Score
15 00:43:14 3576 0 01:28:58 2097 0
>>
File: carbon(12).png (2.47 MB, 1674x4620)
2.47 MB
2.47 MB PNG
>>103523678
code gets longer with each passing day

>>103523782
perhaps all the LLM fags just packed their bags and left, because this one should have been easy for them
>>
File: 1722305116156481.png (1.59 MB, 1616x3872)
1.59 MB
1.59 MB PNG
Cute problem. I was hoping for a good time so I just went with the possibly-least-effort solution (try pushing only the robot, if that runs into something else add that to the list of things to push, and retry the whole move until you either succeed or run into a wall), because I thought it might be faster to write than a proper one. Ended fucking up the swapping a lot though, so that didn't work out lol. Do not look at pic related, there are no insights to be gained.

Grepping the output for '[^\[]\]' helped significantly.
>>
>>103523833
Maybe check for box amount, you could be removing or adding some.
#######
#.....#
#.....#
#..[].#
#.[][]#
#..@..#
#######

^

I had a bug where that would also pick one side of the right box, but that should be covered by the smaller test input.
>>
>>103523881
>cute
hang yourself troon
>>
>>103523886
rent free
>>
>>103523841
Make a proper input.
>>
eric should've just made the boxes 2x2 instead of making them wide
>>
>>103523895
do it yourself retard
>>
>>103523886
stop shitting up the thread with off topic shit. besides, you sound like someone who has never had kids to get hung up over that word
>>
>>103523896
what if he made them + shape
>>
File: 1711350126811404.mp4 (15 KB, 512x512)
15 KB
15 KB MP4
>>103523886
No, I don't think I will~
:)
>>
>>103523903
now THIS would be a problem worth solving
>>
>>103523841
All of them work fine>>103523883
>>103523883
Works too

Thanks anons but I will be importing solution from reddit now and log the box coordinates for each step to see where I divert.
>>
I hate these puzzles, I would always mess up some fucking indexes. I am not washing this shit.
Error: Image resolution is too large.
https://pastebin.com/D7XUxbxA
>>
>>103523841
thank you anon, I'm free now
>>
>>103523886
I thought it was cute and I disavow niggers, trannies, and the Talmud
>>
What is Touhou?
>>
>>103523949
I was referring to the fact that troons are tryhard want to sound like biological females 100% of the time, and they fail miserably.
That's why they say things like "cute" or use characters like ~, use the work like 100 times in a sentence, etc. No XX would ever do any of these btw so it's an instant giveaway.
>>103523955
some word in the zoomerlingo of /v/ tourists
>>
>made the big sample work
>input still fails
AAAAAAAAAAAAAAA
>>
This issue is getting a bit heated~
Please slow it down or I'll have to lock the thread~
>>
Anons do you get 1471468 for this
https://pastebin.com/m06H8Rdi
>>
>>103523981
bad link
>>
>>103523912
>>103523903
How is that any harder? It just means checking three locations to see if a box can move instead of two.
>>
>>103523984
what if the boxes could be any arbitrary shape
>>
File: day15clojure.png (2.16 MB, 1017x1553)
2.16 MB
2.16 MB PNG
>replace your boxes with two tokens
no, I don't think I will, thank you eric
I will continue to use a single token for each box
>>
File: bqn.png (134 KB, 763x1338)
134 KB
134 KB PNG
the worst bqn you've ever seen for part1
I don't know nearly enough to actually write reasonable code in this language
on the bright side I don't feel bad about part2 trashing all of this code
>>
File: wrong.webm (184 KB, 359x319)
184 KB
184 KB WEBM
I see what is happening.
>>
>>103523990
That would be more code but conceptually not too hard
Just walk the perimeter and check if anything bordering it in the move direction isn't movable
>>
>>103523984
###########
#.........#
#....#....#
#...###...#
#....##...#
#..@.###..#
#.....#...#
#.........#
###########

>>>
>>
>>103524008
what if the boxes are empty carboard boxes so could fold and crumple as you push them
>>
>recursive function is fucked
>instead of redoing it, try to fix it
>Its been an hour
I am so frustrated it is unreal. I am going to SCREAM
>>
>>103523981
https://0x0.st/XFV0.txt
>>103523983
>>
>>103523981
>>103524016
>do you get 1471468 for this
no
>>
>>103524016
>>103524021
me neither
>>
>>103524014
based grodnard
slam your mouse on the desk every time you get angry, it helps
>>
File: carbon.png (592 KB, 1430x4002)
592 KB
592 KB PNG
Part 1
data = open("Day 15 input.txt", "r").read().strip().split("\n\n")

grid = {}
for y, line in enumerate(data[0].split("\n")):
for x, char in enumerate(line):
if char == "@":
pos = [x,y]
char = "."
grid[(x,y)] = char

size = [len(data[0].split("\n")[0]), len(data[0].split("\n"))]
dirs = [[1,0],[0,1],[-1,0],[0,-1]]

for move in data[1]:
if move not in ">v<^": continue
move = {">":0,"v":1,"<":2,"^":3}[move]
dx, dy = dirs[move]
if grid[(pos[0]+dx, pos[1]+dy)] == ".":
pos[0] += dx
pos[1] += dy
continue
elif grid[(pos[0]+dx, pos[1]+dy)] == "#":
continue
elif grid[(pos[0]+dx, pos[1]+dy)] == "O":
end = [pos[0]+dx, pos[1]+dy]
while grid[tuple(end)] == "O":
end[0] += dx
end[1] += dy
if grid[tuple(end)] == "#": continue
grid[tuple(end)] = "O"
grid[(pos[0]+dx, pos[1]+dy)] = "."
pos[0] += dx
pos[1] += dy

total = 0
for i in grid:
if grid[i] == "O":
total += i[1]*100+i[0]

print total

Part 2 in picture, way too long to fit both. Syntax highlighting it fucked up because carbon is a hopeless piece of shit and none of the few controls it gives would fix it.
Code really is an abomination today.
>>
>>103524004
I think I had that happening when I forgot to throw out all the data in my BFS when it hit a wall and let part of the move through anyway, I was missing one or two of lines 128-130 here >>103523758
>>
File: 1732873018025944.png (935 KB, 2048x4300)
935 KB
935 KB PNG
Swift.
Today was easy, but required a lot of typing.
>>
      -------Part 1--------   -------Part 2--------
Day Time Rank Score Time Rank Score
15 00:12:46 284 0 02:02:38 3107 0

Today filtered me fucking hard. So many edge cases.
>>
File: 1726396990325250.png (3.11 MB, 880x4022)
3.11 MB
3.11 MB PNG
this is a mess but I don't want to keep washing it
>>
File: hopes.jpg (55 KB, 546x896)
55 KB
55 KB JPG
>>103524014
>>103524027
>have a random (1,0) instead of a (0,1) inside my vertical push function
I am going to cry.
>>
File: UNWASHED ASS.png (510 KB, 1019x3575)
510 KB
510 KB PNG
>>103524048
UNWASHED ASS as usual.
>>
Edgecase bros
```
####################
##................##
##........##......##
##........[]......##
##......[][]......##
##.......[].......##
##.......@........##
##................##
##................##
####################
```
>>
FUCK
#########
#.......#
#....#..#
#.[][]..#
#..[]...#
#..@....#
#########
>>
>>103524064
Works on my machine.
>>
>>103524064
Um, sweetie, his is not an edge case
>>
>it took 32 minutes for the part 2 global leaderboard to fill up
Why didn't (You) get a top 100 rank? Surely half an hour is enough time to solve a simple programming puzzle?
>>
File: Carlos-disappointed.jpg (9 KB, 210x240)
9 KB
9 KB JPG
>>103524081
Fuck you.
>>
>>103524081
I wasted a ton of time trying to handle edge cases until I decided to nuke all of it and try a different strategy.
>>
File: carbon.png (752 KB, 1578x4790)
752 KB
752 KB PNG
I hate edge cases
>>
>>103524081
I spent hour and a half debugging my shitty code.
>>
File: image.png (9 KB, 617x71)
9 KB
9 KB PNG
guess which part had working examples and broken real input
>>
>>103524081
not a simple puzzle bro
>>
File: fug.png (316 KB, 425x450)
316 KB
316 KB PNG
>best placement to date
>1 hour and 39 minutes in
wew
>>
My edgecase was:

[]...
[]...
.[]##
..[]..
..^..

I pushed the right half of the bottom box into the obstacle. Fuck.
>>
> edge case
> literally just a regular case
>>
>>103524081
It took me exactly twice that long because there was a lot of typing
>>
>>103524081
>>103524088
>I spent hour and a half debugging my shitty code.
This
>>
all my boxes in the big example are in the right position except for 1 but I can't for the life of me find where it goes wrong
>>
File: file.png (123 KB, 3834x2152)
123 KB
123 KB PNG
>>103524125
What I did was print the grid in each iteration to a file, and then do 13dd in Vim and repeat it to watch all the steps.
>>
>>103524125
print every single step with position, direction and, if you can, output of your box finding algo
>>
>really like my part 1 solution
>realize part 2 needs an entirely different approach half way into extending part 1 for it
damn it
>>
>>103524139
>>103524136
yea I think I will have to do that to see what I'm missing. I've tried all the "edge" cases anons have posted here and they have worked from the get go.
>>
There are literally NO edge cases in this problem. They all are regular cases.
>>
>>103524113
edgecase bros!!?
#######
#.....#
#.@...#
#.....#
#######

>>
>>
>works on both examples
>doesn't work on input
any edge cases for me to try? my final output map doesn't look malformed so whatever is broken is not in a completely broken way
>>
>>103524152
edge case just means something easy to miss or fuck up
>>
File: oof.png (12 KB, 634x67)
12 KB
12 KB PNG
womp womp
>>
>>103524159
try to console write the input and the sample and see if there's any differences in the way it gets returned compared to the source maps.
>>
>>103524158
unforgivable
eric should have given us this in an example...
>>
>>103524159
Maybe you messed up pt2 gps coordinates
>>
A lot of grid problems this year, I wonder if it's just a coincidence or not.
>>
It's not that hard. Just push the boxes
>>
>>103524159
count number of boxes
>>103524109
>>103524068
>>103523841
captcha:NGGA
>>
>>103524159
if nothing works then you can always read the input as bytes and work with that rather than the ascii chars.
>>
>>103524148
okay I solved it. in one of the push cases I was checking the wrong coordinate because I copy/pasted that code instead of writing it. A +1 that should have been in the other cardinal.

Oh well, it work at once with the real input so it's fine
>>
File: file.png (29 KB, 712x855)
29 KB
29 KB PNG
>>103524206
https://pastebin.com/jvTAYkjW
how off does pic related (final state) look with my input? examples work
>>
File: push the fucking boxes.png (193 KB, 680x452)
193 KB
193 KB PNG
>>
>>103524216
Link is dead. Why is everyone replacing the original ascii characters with double characters?
Just read the input as bytes. No need for all of that.
>>
>>103524081
i got frustrated after 10 minutes and went to jerk off instead. came back an hour later with a clear head and then finished it
>>
File: d15.png (1.65 MB, 1656x9804)
1.65 MB
1.65 MB PNG
We did it /g/
>>
>>103524249
based
>>
I don't like that my input's robot's directions are extremely transparently just a random walk algorithm. I was thinking about making a proper visualization, but the robot spends so much of its time waffling around without doing anything, and so few of the boxes actually end up touched, it would just look lame.
>>
File: d15.webm (31 KB, 80x40)
31 KB
31 KB WEBM
>>103524250
And my visualization of the example because the full input is over 2 minutes.
>>
>>103524264
bigboy for today should make the end result spell something
>>
I'm noticing lots of robot themes in the story. What does Eric mean by this?
>>
good morning sirs! comfy cnile part1
part2 ahead of me, god that looks like such a time sink and can't reuse anything from part1
>>
All in all, I liked todays problem.
Part 2 was interesting, introduced a bunch of edge cases your solution had to handle. Visualizing the output was a big help.
>>
File: d15.webm (2.44 MB, 400x200)
2.44 MB
2.44 MB WEBM
>>103524265
OR I could just set it to 180fps.
>>
>--- Part Three ---
>Each line of directions in your input is actually a robot state.
>The states are generated based on a secret algorithm. Although you have the first few, the robot will actually continue to generate more states and then run the resulting instructions.
>The elves speculate that this robot, too, is the same model as the ones from the North Pole, and so the boxes should eventually be moved into the shape of a Christmas tree.
>Figure out the secret algorithm from the states given in your input. When the robot runs indefinitely, how many states must it run before your input reveals a picture of a Christmas tree?
>>
>>103524323
Damn, AoC++ looks fun.
>>
>>103524216
https://pastecode.io/s/gt6jf062
pastebin is borked, same question though, how wrong does my image look with this input? all my edge case tests work fine and I solve the examples correctly. also anyone else have an input I can try out to compare
>>
>>103524264
>just a random walk algorithm
to be fair, the description does say
These lanternfish seem so anxious because they have lost control of the robot that operates one of their most important warehouses! It is currently running amok, pushing around boxes in the warehouse with no regard for lanternfish logistics or lanternfish inventory management strategies.
>>
can you make fake spoiler tags on /g/ like this
There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line There is a spoiler at the end of this line I am secretly a homosexual
>>
File: offbyone.png (26 KB, 805x902)
26 KB
26 KB PNG
>>103524342
>>
This was the simplest and most straight forward problem so far.
There is literally no puzzle to be solved.
>>
>>103524364
bait
>>
>>103524365
He's right though. It's literally just "implement this" without any tricks to figure out.
>>
>3 hour mark
>just hit the "works on test, not on input" stage
oh no. I was really hoping it work work first try....
>>
File: dangergroup.png (59 KB, 752x452)
59 KB
59 KB PNG
These people are all in danger.
I will be checking tomorrow, if the leaderboard is full some of you will be going.
>>
>>103524387
There are a few edge cases you need to take into account.
If you want a hint, I'll give you one or look up in the thread.
>>
The issue for me was basically that for part 1 I did the "can move" check and the actual movement in one set of recursion. Instead, what I had to do was do one preliminary move check without moving, then unconditionally move everything. This helped because when you try to do a "can move" check on a box that is in the process of moving, the second half of the box checks based on what already happened to the first box, which isn't always correct.
I liked this problem, though. A lot of fun
>>
does part 2 measure differently?
>measured from the edge of the map to the closest edge of the box in question
is this still from the top & left edge (and thus always match with '['), or am I supposed to do the closest edge to the left / right of the box
>>
>>103524402
damn, if only eric told us this we wouldn't have to guess
>>
>>103524365
Retard-kun... It's literally just pushing and popping coordinates from a queue and conditionally updating the state. How are you struggling with this at this point?
>>
>>103524398
don't want to be filtered. I will figure it out.
>>
>>103524399
>the second half of the box
you fell for his trap, baka
just treat them as one box (single token on the left hand side), and expand your collision checking
>>
>>103524432
I just dijstra'd my way along the 'box path' and marked all the tiles, then applied gravity to all marked tiles for 1 unit. if any landed on a wall, I reverted.
>>
>just found out that clojure supports fraction literals (you can just type something like 5/12 and it's valid)
that's very cute
>>
>>103524449
>cute
*kawaii
>>
>cannot invent an edge case my solution beaks with
>wrong answer
AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
>>
>>103524315
Look at him go!
>>
File: 1720241028128594.jpg (202 KB, 1024x1024)
202 KB
202 KB JPG
>>
>>103524473
same. All multipushes work. weird trees with blocks in them all work. I am losing my mind
>>
who's gonna make the robot that pushes ywnbaw
>>
>>103524473
>>103524482
Make sure you are calculating the gps coords correctly
>>
>>103524473
are you counting the box positions for the calculations before or after? for me I was keeping track while I was going and even though my boxes were in the right spot the box cache was wrong and needed to be fixed. there can be edge cases with that
>>
>>103524493
im getting 9021
>>
>>103524493
>>103524496
yes, not only does my image match for the example input, but my calc is the same too
>>
>>103524473
>>103524482
Start visualizing your output.
>>
>>103524505
bro it's like 20k steps and I have no idea when it starts diverging
>>
>>103524449
>>103524456
banning troons from this board would significantly raise the average intelligence in these threads
>>
--- Part Three (AoC++) ---
After successfully finding a safe path through the second warehouse, the lanternfish are suprised to see that a third robot is also malfunctioning!
The third warehouse's layout is also similar to the first, with two key differences: It is twice as wide and twice as tall!
What is the sum of all the boxes GPS coordinates?
>>
>>103524346
True, but it could be rewritten so that the robot was hacked by drunken Elves. If it were up to me, I'd write a program that shuffles the boxes around to read MERRY CHRISTMAS, or whatever.
Hell, you could have it spell out something completely different for each part. You'd just have to have your puzzle generator working with both parts at the same time, I'd probably have it alternate between a set of steps that pushes a box in part 1 into its intended final destination location, then a box for part 2, etc. Make sure no move accidentally moves a "fixed" box out of place in either part, and while you're e.g. working on moving a part 2 box, use Dijkstra or whatever and give extra weight to moves that would be invalid in part 1, and vice versa, just to keep the chaos down.
>>
>>103524512
not that hard desu just copy+paste the vertical logic for part 2 and convert it to horizontal logic
maybe if part 3 introduced diagonal movement or something
>>
File: aoc_15.png (246 KB, 2000x1000)
246 KB
246 KB PNG
Holy wall
>>
I want a 3D grid problem. Moving boxes in 3 dimensions, would love to visualize that.
>>
>>103524532
what happened in 2018???
>looks
oh
yeah
that makes sense
>>
>>103524502
shot in the dark but try this
###########
#.........#
#.........#
#.........#
#...O#....#
#..@OO....#
#....O....#
#.........#
#.........#
#.........#
#.........#
###########

>>vv>>^

make sure it looks like this afterwards
######################
##..................##
##..................##
##..................##
##......[]##........##
##.......[][].......##
##........[]........##
##........@.........##
##..................##
##..................##
##..................##
######################

answer would be 2038
>>
>>103524542
also this one perhaps
###########
#.........#
#.........#
#.........#
#...O#....#
#...OO....#
#..@O.....#
#.........#
#.........#
#.........#
#.........#
###########

>>v>^

gold 2035
>>
--- Part Three ---
Up until now you have worked in a warehouse with a single robot.
In the next warehouse, there are twenty robots, one per line of commands.
The robots communicate wirelessly, so if more than one robot would move the same box in a given cycle, none of the affected robots move.
What is the sum of all the boxes GPS coordinate?
>>
>>103524542
correct image and answers. I actually found an instance of where my bug is, but it makes no sense. for no reason at all, my robot refuses to move down when there is an unobstructed tile below it. I can't recreate it with a test input
>>
File: happy_wagie.jpg (33 KB, 612x423)
33 KB
33 KB JPG
YES!

YEESSSSS!

I'M NOT FILTERED!!! HAHA!!!! LET'S GO!
>>
>>103524574
how do you perform move logic, when your robot moves do you consult the coordinate at an actual representation of the graph, or do you check the coordinate against a list of boxes/obstructions? if the latter (not sure why you would do that, but maybe) then perhaps something got moved and left behind a trace?
either that, or if you want to try for a recreation, have it perform one move before doing a down move. try unobstructed/box/wall in each direction other than down, just before the down move and see what happens
>>
>>103524509
11mins at 30fps.
You'll probably have a block phase into another one, or blocks move past a section of wall they shouldn't.
>>
>>103524580
this is how I look and how I act and what I say when I solve the puzzle
>>
>>103524574
>for no reason at all,
Aka, a bug in your code.
>>
>found my edge case
oh thank god. Its probably not applicable to you guys. My box randomly splits in two but only sometimes.
>>
>>103524509
Make sure all your [] are matched
Make sure total number of each character doesn't change between any rounds
>>
Elves BTFO
Lanternfish BTFO
>>
>>103524582
conceptually I backup my grid, use a DFS to mark the tiles that could move (can only traverse in the current direction), rotate the grid so that the move direction is pointing 'up', then go row by row swapping a cell below the current cell if it's marked. if I want to swap but the current cell is a '#' then I flag the move as invalid and restore the backup
>>
File: shoot_2024-12-15_03:51:56.png (1.15 MB, 1669x6813)
1.15 MB
1.15 MB PNG
It has been nearly 4 hours.
I completed part one in about half an hour. My part 2 code passed the test input after another half hour.

I was chasing a bug for the past three hours. I rewrote everything. I tested every case. I couldn't find it.

The bug in question? In one of my many functions i used "pos" as a variable when I should have used "p". Python HELPFULLY pulled my pos variable out of global scope when it didnt exist in the local function scope...... why the test cases still worked is beyond me

This experience may make me become a rusttranny or something. strict language bros..... I apologize..... I see the error of my ways now......
>>
>>103524239
who cares nigga stop trying to act smart
>>
>>103524708
enjoy your reading errors
>>
>>103524747
i have no errors and i finished the puzzle hours ago
>>
>>103524695
I haven't actively worked with Python for years (thankfully), but I remember you had to do something like
global pos

for that shit to happen, or did they change it/I misunderstood?
>>
File: file.png (6 KB, 184x206)
6 KB
6 KB PNG
>>103524755
no idea what that guys talking about
this gets "NameError: name 'test' is not defined" for me
>>
>>103524755
all i know is I did
def function(p)
do_shit(pos)

and it ran fine without errors.
>>
>>103524751
I pity the company that hired/will hire you.. can't imagine the garbage code you'll leave to them.
>>
>>103524766
moron
>>
>>103524755
Variables made outside a function have global scope by default.
If you want to make a variable have global scope from inside a function, you use global set its scope to global.
>>
>>103524766
Which solution is yours?
>>
File: 24_D15_C#.png (1.08 MB, 2372x5136)
1.08 MB
1.08 MB PNG
C#
>>
File: 1678470429202.jpg (69 KB, 522x503)
69 KB
69 KB JPG
LLMchads keep winning, damn it feels nice to put this into my resume after having cheated my way to day 15
>>
>>103524920
>employer judging my unwashed ass
nightmare scenario, no thanks.
>>
did everyone else do dfs for p2 vertical?
>>
>>103524587
wtf me too
>>
>>103524542
>>103524549
Thanks for these examples, very helpful, I ended up refactoring everything anyway

This is how I feel right now
https://www.youtube.com/watch?v=AAaKGIqgyvI
Still not filtered!
>>
File: out.webm (3.33 MB, 100x100)
3.33 MB
3.33 MB WEBM
tedious
>>
>>103524487
https://0x0.st/XF4s.txt
>>
File: day15-mathematica.png (230 KB, 1642x2388)
230 KB
230 KB PNG
Tiresome, but I'm glad it's over.
>>
not filtered yet but that was annoying
>>
>>103523634
Exactly how I felt. I took a break, and came back to it.
>>
Bigboy
https://files.catbox.moe/dis0nh.7z
3000x3000 grid, 72 million steps

Part 1: 356166839889
Part 2: 359696176529
>>
File: img-2024-12-15-11-26-49.png (2.36 MB, 5546x8392)
2.36 MB
2.36 MB PNG
idiomatic Rust solution

>>103525145
31s
>>
Well that's not right
>>
File: file.jpg (336 KB, 600x900)
336 KB
336 KB JPG
>>103525184
>>
File: 1713021081260437.gif (338 KB, 538x572)
338 KB
338 KB GIF
>>103525201
KEK
>>
File: day15.png (234 KB, 732x2440)
234 KB
234 KB PNG
non-idiomatic Rust solution

>>103525145
13 seconds
time ../../target/release/aoc_2024 <./bigboy.txt
day15 result:(356166839889, 359696176529)
../../target/release/aoc_2024 < ./bigboy.txt 12.68s user 0.00s system 98% cpu 12.845 total
>>
spent 1 hour to parse this shit and now i don't have time to even solve part 1... see you fags in 10 hours
>>
>>103525216
enjoy work, faggit
>>
File: img-2024-12-15-11-36-30.png (2.42 MB, 5546x8522)
2.42 MB
2.42 MB PNG
improved idiomatic Rust solution

>>103525145
~13s
>>
>>103525216
>competent enough to make it to day 15
>can't parse grid input in less than an hour
We've done like 5 grids though??????
>>
>>103525215
your solution for yesterday was cool
>>
File: carbon (11).png (608 KB, 1118x3035)
608 KB
608 KB PNG
By far my ugliest solution, even after spending a bunch of time cleaning it. But hey... NOT FILTERED, BABY!
>>
>>103525233
most of it was fighting the language and debugging off by one errors
>>
>>103525145
code in >>103524051
356166839889
359696176529

real 0m2.966s
user 0m2.845s
sys 0m0.107s
>>
Great, some of my part 2 antinodes aren't going in.
This will be fun to debug.
>>
>>103525317
>antinodes
FILTERED
>>
>>103525274
that's kinda fast actually.
I wonder where the performance difference comes from, since at first the logic seems quite similar to e.g. >>103525232
>>
File: 15.mp4 (212 KB, 600x300)
212 KB
212 KB MP4
>>
>>103525145
My code is in >>103523811. 74.6 seconds with pypy3.
>>
>>103525366
>>103524990
>>103524315
>>103523685
he fucking sucks at his job
>>
>>103525403
don't worry, tomorrow will be to program him correctly
>>
>>103525403
I was disappointed that Eric didn’t encode an actual easter egg for visualization creators. Lazy.
>>
10 days left... I don't want to go back bros...
>>
File: day8gold.png (17 KB, 801x628)
17 KB
17 KB PNG
>>103525326
Not filtered.
>>
>>103525403
>These lanternfish seem so anxious because they have lost control of the robot that operates one of their most important warehouses! It is currently running amok, pushing around boxes in the warehouse with no regard for lanternfish logistics or lanternfish inventory management strategies.
>>
File: day15.png (1.47 MB, 1024x1024)
1.47 MB
1.47 MB PNG
just finished part 1, on to part 2 but for here's a base for the calendar (probably should swap out the robot for smug business pepe and edit in crying wojack on the fish or something)
>>
File: img-2024-12-15-12-20-47.png (2.14 MB, 5600x6832)
2.14 MB
2.14 MB PNG
idiomatic Rust solution (final)

>>103525145
~11.5s
>>
>>103525463
>hey guys I typed 10 words into an image generator and I have some ideas on how to change it so it's particularly cancerous
Thanks
>>
>>103525463
would rather have a blank calendar day than an AI calendar day, even if edited
>>103524218 would be a better calendar
>>
>>103525475
brother nobody cares
>>
>>103525502
You sound filtered.
>>
>>103525463
pretty dogshit, ngl
>>
>>103525502
i care :)
>>
File: idiomatic_calendar.png (3.17 MB, 7915x4160)
3.17 MB
3.17 MB PNG
>>103525502
so?
>>
File: 20241215_202341151_1.webm (3.64 MB, 1080x1080)
3.64 MB
3.64 MB WEBM
>day 9 is the disk defragmenter
Aww fuck. How in the hell am I going to do this.
>>
File: day8.png (463 KB, 1951x1912)
463 KB
463 KB PNG
>>103525546
Code.
>>
File: day-15.png (458 KB, 861x2148)
458 KB
458 KB PNG
>>
>read part 2

yeah i declare myself filtered, not even gonna attempt this shit
>>
>>103525145
Go
356166839889
359696176529

real 0m1.818s
user 0m2.447s
sys 0m0.105s
>>
>>103525566
Oh come on. It's not THAT bad.
>>
>>103525566
you're allowed to do that but just be aware that I now consider myself better than you (a random stranger on the internet).
>>
>>103525566
the trick is to dfs in that direction; check my `vertical` function: >>103525558
when you dfs and all leaf nodes can move, then you dfs again and move all nodes by 1
i'm rotating everything every time so i only have to consider one case: moving right
>>
File: 202415.jpg (77 KB, 720x720)
77 KB
77 KB JPG
calendar image
>>
>>103525594
I was going to try to come up with something funny but I couldn't, this works
>>
>>103525594
>>103525600
needs to be wider
>>
>>103525566
if you only finished part 1 now then yeah you have no hopes for part 2
>>
File: lol.png (6 KB, 189x96)
6 KB
6 KB PNG
>>103525475
>11.5 s
lol. Witness the power of non-Rust-idiomatic C++. I haven't optimized shit, this is just the first thing I wrote.
>>
>>103525612
You don’t know when he started.
>>
File: work harder.webm (2.27 MB, 458x708)
2.27 MB
2.27 MB WEBM
i'll do part 2 later, I do the pushing recursively and adding branches shouldn't be too difficult I think
>>
File: 1731901249140092.jpg (279 KB, 1440x720)
279 KB
279 KB JPG
>>103525605
>>
File: code.png (1.59 MB, 901x9247)
1.59 MB
1.59 MB PNG
I am NOT cleaning this up

>>103525145
Rust, 4.5s
>>
>>103525655
perfect
>>
>>103525660
>500 lines
>will NOT fix, closing this issue
so this is the power of rust?
>>
>>103525660
How in the fuck
>>
File: donttalktomeormyson.png (821 KB, 1440x720)
821 KB
821 KB PNG
>>103525605
>>103525594
>>
where the cniles @?
>>
>>103525660
what the fuck, my unwashed was less than a hundred lines
>>
>>103525685
Sovl.
>>
>>103525605
>>
>>103525698
doesnt look very out of control to me... he needs to be running amok more
>>
File: 1717621268688300.png (545 KB, 1024x6159)
545 KB
545 KB PNG
>>103525687
Is C-style C++ okay?
>>
>>103524389
Most of those should just be removed anyway, they're clearly no longer participating.
>>
File: idiomatic.png (1.46 MB, 2948x4584)
1.46 MB
1.46 MB PNG
>>103525660
ah, excellent
>>
>>103524389
They should have been booted long ago, they embarrass us.
>>
File: messier warehouse.png (414 KB, 622x313)
414 KB
414 KB PNG
>>103525708
>>
>>103525741
good job, you made it a little more idio(ma)tic
>>
Day 14 - I was worried today was going to be a difficult math or logic puzzle. Turns out, it's just a simulation-type puzzle that I can spaghetti my way out of :P

https://pastebin.com/vKbG8TbN
>>
>>103525754
fire
>>
>>103525754
based
>>
File: aoc24_15.png (599 KB, 718x3896)
599 KB
599 KB PNG
Odin
Well this took a while.
On the plus side, I found a use for the fallthrough statement
>>
>>103525145
10 seconds
>>
File: Day15.png (287 KB, 1075x2501)
287 KB
287 KB PNG
C#. Rapidly approaching the "What the fuck am I coding" stage.
>>
is timeenjoyed filtered yet?
>>
I am too hungover to help Santa today bros. I think I will unfilter myself tomorrow.
>>
File: longcat.png (2.58 MB, 1126x9431)
2.58 MB
2.58 MB PNG
>>103525660
>>
>>103525754
that's it, it's perfect
>>
File: timeenjoyed.png (54 KB, 586x351)
54 KB
54 KB PNG
>>103525813
apologise.
>>
>>103525735
>>103525743
This is true. I want to keep the booting to when it is necessary mostly.
>>
I wont post my code because its some horrible copy paste shit of all the directions checking and moving.
but sigh. I just 'brutefoce' made a grid and move my boxes around.

1h after the start I was force to go to the fucking christmas market.
>cope
I spend like 1h max coming back just finishing part 2.
>cope and seething.

      --------Part 1--------   --------Part 2--------
Day Time Rank Score Time Rank Score
15 00:37:02 2924 0 07:15:47 8806 0
>>
NEW THREAD
>>103525934
>>103525934
>>103525934
>>
>>103525754
Excellent
>>
File: day15.png (1.49 MB, 2048x7372)
1.49 MB
1.49 MB PNG
>>103525145
Unwashed C++
$ time ./main bigboy.txt 
356166839889
359696176529

real 0m6.360s
user 0m6.075s
sys 0m0.284s
>>
>>103525660
and I thought my unwashed 215 lines mess was bad
>>
>>103525145
weapon of java coming through
overall, a fun problem, not too hard not too easy, I liked it. good job eric.

>>103525754
topkek
>>
File: 2024-12-15_13-25.png (266 KB, 2100x1315)
266 KB
266 KB PNG
>>103526336
forgot screenshot mb
>>
>>103526348
>hiding moveW
>>
File: 2024-12-15_13-34.png (93 KB, 1054x566)
93 KB
93 KB PNG
>>103526394
gotta fit stuff in the screenshot and it's the least interesting part of the problem, but here you go
>>
.O.O.
..O..
..O..
..O..



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.