[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: 1734506752255253.png (999 KB, 1349x1024)
999 KB
999 KB PNG
maze constipation 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: >>103554593
>>
File: img-2024-12-18-12-32-43.png (1.17 MB, 5600x3582)
1.17 MB
1.17 MB PNG
idiomatic Rust solution
>>
part 2 in single dfs. erics mazes are too predictable
def part2(coords: list[tuple[int, int]]):
maze_done = next(
i for i, (x, y) in enumerate(coords) if x % 2 == 0 and y % 2 == 0) - 1

blocked = {*coords[:maze_done]}

curr = deque([(0, 0)])
visited = {(0, 0)}
preds = {}
while curr:
(x, y) = curr.popleft()
for dx, dy in (-1, 0), (0, 1), (1, 0), (0, -1):
nx, ny = x + dx, y + dy
if 0 <= nx < 71 and 0 <= ny < 71:
if (nx, ny) not in visited and (nx, ny) not in blocked:
curr.append((nx, ny))
visited.add((nx, ny))
preds[(nx, ny)] = (x, y)

path = []
p = (70, 70)
while p in preds:
p = preds[p]
path.append(p)

return next((x, y) for (x, y) in coords if (x, y) in path)
>>
File: carbon.png (657 KB, 1650x3798)
657 KB
657 KB PNG
kill me, i only realized i could do -1,0 1,0 0,-1 0,1 after writing this piece of shit
brooted of course
>>103559822
anon, that's the name field...
>>
>>103559846
i dont get it
>>
>>103559857
the mazes are created in such a way, that there is never a wall on coordinates with 2 even entries.
so teh first time you see such an entry is the point where the maze is done and the rest gets filled.
since in that maze you only have 1 valid path, just find the first entry on that path.
>>
>>103559846
doesn't work for my input
>>
>>103559851
anon has become /aocg/, duh
>>
>>103559867
For what?
>>
>>103559851
>anon, that's the name field...
i use rust btw idk if that matters
>>
>>103559851
Never touch a computer again
>>
>>103559888
I put my name in the options field on accident btw idk if that matters
>>
File: file.png (124 KB, 338x634)
124 KB
124 KB PNG
>>103559893
still finds it in catalog if you search for /aocg/ so its fine
>>
>>103559880
can you post your input? (that is if you are not scared of eric)
>>
>>103559867
>there is never a wall on coordinates with 2 even entries
What the fuck does that mean? What are you using "entries" to refer to?
>>
>>103559867
i still dont get it
>>
>>103559923
the two coordinates are even like (50,28)
I guess this might fail sometimes if you are unlucky and the first "filler" point happens to not land on such an entry. chances of it working should be at least 25%.
>>
>>103559937
Okay so you're bad at using words and your solution is retarded. Understood.
>>
>>103559822
>Edition
kys
>>
>>103559944
Yeah, you could say that. But still, I mean it works on my input. it might be fixable still. the distance between the maze done and the first filler point with 2 even coordinates should be quite small.
>>
>>103559920
https://0x0.st/XCTC.txt
p1: 356
p2: 22,33
>>
File: anon_sol.png (28 KB, 640x480)
28 KB
28 KB PNG
>>103559973
it does work. I get 22,33 for your input. the path in the picture is the one found and the blocked stuff are all block up to index "maze_done"
>>
>>103560017
I lied
>>
>>103560021
no, but actually you are correct. the probability of the algorithm working is almost exactly 50:50. so I guess it was just lucky
>>
comfy cnile, didn't post few last days need to catch up. at least today was trivial.
Got an idea for similar puzzle - solve maze where the walls are changing over time. E.g. block drops and stays blocked for certain amount of time (third column).
This was basically bruteforce after each block until you find the maze unsolvable. Kinda boring.
>>
>>103559846
>>103559867
>>103559937
>>103559962
so what you're saying is,
>the bytes always fall in a specific way
>they're not random, because the first half constructs a maze with single width tunnels and no open spaces (just look at >>103560017 's pic)
>because the maze is generated such that the hallways and walls are 1 tile wide, this results in a pattern where both vertical wall lines and horizontal wall lines are only on odd indexes
>therefore, a byte like (50,28) will never appear before the maze is complete, because that would be a "hallway" tile
>once the maze is complete, the second half of falling bytes start filling up the hallway
>the maze is also generated so that there is only one path through it
>if you know that the maze is complete, and bytes are starting to fill up the hallways, and you also know the one and only path through the maze, you only have to look for the first byte that covers your current pathway to get the byte that stops completion
am I understanding this correctly?
I think you assume that "filler bytes" have to have both x and y be even, but that isn't true
you could get a filler byte that covers the only path before you get the filler byte that has both coordinates be even
>>
>>103559851
There's a reason I have
vh = [ (-1,0), (1,0), (0,1), (0,-1) ]

In my template file.
>>
>>103560202
same >>103560079 in the aoc.h header
static const vec2i dirs[4] = {
{-1, 0},
{ 1, 0},
{ 0, -1},
{ 0, 1},
};

although could just do 2d -1..1 loop and if-statement (x||y) && !(x&&y)
>>
>>103560202
ive never done aoc in my life, tbdesu all the algorithmic stuff filters me hard
>>
>>103560202
>>103560222
ever heard of rotation matrices?
>>
>>103560222
>x, y = y, -x
>>
>>103560235
Don't care.
>>
So did everyone else just use their part 1 solution to binary search for the cutoff where the maze stops being solvable?
>>
>>103560235
Do care.
>>
>>103560285
You were literally bitching about how hard it is and muh have to put in template and for loop wizardry, I suggest the simple solution that exists and you don't care? Okay retard.
>>
>>103560287
>binary search every maze
who do you think I am?
I obviously just brute forced it
>>
>>103560303
>You were literally bitching about how hard it is
I wasn't the one bitching.
A simple solution is just a predefined list.
>>
>>103560178
yeah that's a better explanation.
after maze generation is complete 50% of remaining bytes are "double even" and the remaining path only covers some portion of the free space. So the question is: what happens fist? Do we get a "double even" or does the remaining path get covered (by a not "double even"). if the path is about 20% of remaining space the chances are pretty good we get lucky. much more than 50%.
If these filler bytes are true random
>>
>>103560321
The simplest one is the one shortest to type.
>>
>>103560287
>>103560305
if you broot it backwards from a completely full maze while removing walls instead, its very fast
>>
>>103560338
the simplest solution is the easiest to read thoughbeit
>>
>>103560235
I also have rotate_left and rotate_right methods. matrices are kinda overkill for 2d points though
>>
>>103560338
I don't have to type anything because my solution is already done.
>>
File: file.png (149 KB, 611x458)
149 KB
149 KB PNG
>>103560345
>brooting it from behind
>>
>>103559846
>>103560178
okay fixed it.
you can just do dijkstra exploring the paths in order of "earliest closure" i.e. the index at which they get blocked.
in the code the sign is flipped, due to the heap being a min-heap
# single dfs
def part2(coords: list[tuple[int, int]]):
latenesses = defaultdict(lambda: -inf,
{(x, y): -i for i, (x, y) in enumerate(coords)})
curr = []
heappush(curr, (-inf, (0, 0)))
visited = dict()
while curr:
lateness, (x, y) = heappop(curr)
if (x, y) in visited:
continue
visited[(x, y)] = lateness
for dx, dy in (-1, 0), (0, 1), (1, 0), (0, -1):
nx, ny = x + dx, y + dy
if 0 <= nx < 71 and 0 <= ny < 71:
nc = latenesses[(nx, ny)]
heappush(curr, (max(nc, lateness), (nx, ny)))

return coords[-visited[(70, 70)]]
>>
>>103560425
sadly, now that it's dijkstra, we are again O(n*log(n)) since the heap has log(n) operations.
so it does not beat binary search floodfill.
>>
>>103560371
kinda based
>>103560361
holy dunning kruger. 2d 90 degree rotation matrices are
0 -1
1 0
and
0 1
-1 0
In python it's literally dx,dy=-dy,dx
Why would you need a function for that? In cnile too you can write it in 3 lines int t=dx;dx=-dy;dy=t;
Anon this is literally FIRST semester physics undergrad, wtf?
>>
>>103560345
that's overkill optimization
even brooting from the front is too fast to satisfy the broot gods
>>
>>103560469
it's literally that just wrapped in function. u mad bro?
>>
> wake up at 4:30am (bongland)
> decide I'm going to sleep because I have work this week
> check puzzle at lunch
> Its literally just day 16, but somehow even easier
Eric is going too easy on us, I even tried to broot this one for part 2 but it takes only 26 seconds to Pathfind every possible maze until I find a failure, meh
>>
>>103560287
Someone claimed they solved part 2 with a single DFS but I don't see how
>>
>>103560469
>you can write it in 3 lines
>while the list is like 4 lines once, and you can write it in one line if you really want to
I have a literal PhD in Physics, and I usually use a list.
You might want to recheck those rotation matrices as well, because your left turn looks very much like a right turn to me.
>>
My wall index was 2878 out of 3450 (not giving the input eric plz don't kill me) but it seems like binary search takes this into account anyway.
>>
File: dij.png (182 KB, 860x1030)
182 KB
182 KB PNG
Rustbros, is there a more concise way of doing this? It won't even let me put the visited check into a closure because adding current node to visited counts as a mutable borrow for the whole block.
>>
>>103560726
see >>103559842
>>
>>103560681
Where did I label them as cw and anti-cw? The first rotates vectors anti-cw, second cw by the way.
>>
File: file.png (8 KB, 416x102)
8 KB
8 KB PNG
>>103560598
its like one extra line to do it in reverse kek
>>
>>103560735
Hint: the y-axis points downwards.
>>
>>103560726
>stack: PriorityQueue
lol
anyways, do this:
while let Some((y, x), steps) = stack.pop() {
{ .. }
for adj in [(-1, 0), (0, -1), (1, 0), (0, 1)].iter().map(|(dx, dy)| (x + dx, y + dy) {
{ .. }
}
}
>>
>>103560778
I know that retard, I was talking about it generally in a normal cartesian coordinate system. That's why I avoided the terms "left" and "right".
>>
>>103560820
Well we aren't in a "normal Cartesian coordinate system."
I will not be taking any advice from someone that is unable to rotate a vector.
>>
imagine not having helper utils for grids and coordinates by now
>>
>>103560898
imagine having helper utils for grids and coordinates and still not making it anywhere near the leaderboard
>>
>>103560905
says who?
>>
>>103560905
imagine not sleeping at your regular schedule because it collides with AoC release
>>
>>103560913
someone who doesn't have any helper utils

>>103560917
I normally get up at 6:00, getting up 30min earlier is no problem.
>>
>>103560885
Where did I state I was talking about today's problem specifically? You're completely retarded.
If you scroll up a bit, this conversation started with "look this stuff in my aoc TEMPLATE". It's a general discussion about how to avoid having to store all 4 or 8 direction vectors.
>>
>>103560726
Probably storing all neighbors in an array and iterating over them, checking all bounds for each:
for neigh in [(x-1,y), (x+1,y), ...] {
if (0..width).contains(&neigh.0) && (0..height).contains(&neigh.1) {
......
}
}

I don't think you should declare adj that early, unless you really want to access it outside the loop. You can just declare and bind (y,x) to it whenever.
Also this >>103560781 for popping off a queue.
>>
>>103560726
for adj in [(y.wrapping_sub(1), x), (y, x.wrapping_sub(1)), (y + 1, x), (y, x + 1)] {
if adj.0 < height && adj.1 < width {
if !visited.contains(&adj) {
pqueue.push(adj, new_steps);
}
}
}


also

https://everythingcomputerscience.com/discrete_mathematics/Stacks_and_Queues.html
>>
File: im-1734530611077.png (25 KB, 518x572)
25 KB
25 KB PNG
braindead pytoddler solve using binary search for part 2.
we're still due for:
>line segments
>rpg/automata/simulation
>grid where dijkstra won't work
>something totally fucked up like sea monster or 3d cube
>???
it's been a pretty easy year so far, i expect it's gonna get hard any day now.
>>
>>103560986
>grid where dijkstra won't work
what?
what tools do we use then?
please knowledge share
>>
>>103561041
I guess he's talking about last year's longest path problem.
>>
>>103561058
>>
>>103560898
I lost a bunch of time today because I didn't have helpers to build a grid from scratch instead of building from parsing the input. Won't happen again.
>>
>>103561110
Your fault for building a grid in the first place
>>
>>103561041
>>103561058
https://adventofcode.com/2021/day/23 amphipods
https://adventofcode.com/2019/day/18 many-worlds
https://adventofcode.com/2018/day/20
>>
File: file.png (3 KB, 507x31)
3 KB
3 KB PNG
>>103561110
ez in python
>>
>>103560986
no cycle detection this year
>>
wtf is with part2?
I used binary search to find the case where it fails, and it still telling me its wrong?
I confirmed -1 of the result succeeds.
>>
>>103561128
>https://adventofcode.com/2021/day/23 amphipods
solvable with dijkstra. haven't done the other ones.
>>
>>103561210
>advent of inputting the answer in the wrong format
>>
>>103561210
>off by one
gonna fucking kill myself now.
>>
>>103560232
>filters
it strengthens you
>>
>>103561234
ya I did that at first because I just monkey'd it. second part I forgot le parsed[idx] would give me one + the one he wanted.
>>
>>103561226
ah yeah you're right
>>
>>103561210
same happened to me and no idea why
i just deleted it all and it worked when i wrote a new algorithm
>>
is this an idiomatic binary search in rust?

    let part2 = (1024..input.len())
.collect::<Vec<_>>()
.binary_search_by(|&v| {
// ...
}).unwrap_err() + 1024;
>>
>>103561336
no
also, you don't want binary search, but partition point
https://doc.rust-lang.org/stable/std/primitive.slice.html#method.binary_search
>If there are multiple matches, then any one of the matches could be returned.
>>
>>103561336
not quite, consider this:
    let part2 = (1024..input.len())
.collect::<Vec<_>>()
.binary_search_by(|&v| {
// ...
}).unwrap_err().reduce().flip_upside_down().transform().get().unravel().ponder() + 1024;
>>
>>103561345
it's impossible for it to return any matches since the comparator only returns less or greater and the algo is guaranteed on error to return exactly that, the point where it partitions.

really I should only add 1023 though, since it's off by one in terms of what I have to access in the input.
>>
>>103561345
I didn't know about partition_point thoughbeit.
>>
>>103561364
>
        }).unwrap_err().reduce().flip_upside_down().transform().get().unravel().ponder() + 1024;

I kneel rust-sama
>>
>>103561345
ok I kek'd and reimplemented it basically:
https://doc.rust-lang.org/stable/src/core/slice/mod.rs.html#4214-4216
>>
>>103561364
>>103561385
what is all the unwrap nonsense that litters every shit-begrimed rust code snippet i see?
>>
>>103561410
that's how monadic types work.
if you don't want to map into them, you map into them by effectively saying, if it is unexpected, panic. that's all unwrap is.
>>
>>103561410
it's called error handling
https://doc.rust-lang.org/stable/std/result/index.html
>>
>>103561210
>>103561266
Fencepost error? If you e.g. find 1336 walls is passable and 1337 isn't, the index of the blocking wall is 1336, not 1337.
>>
>>103561428
no, my error was I was literally off by one and returned the next tuple that failed, not the exact failing case.
>>
>>103561419
>>103561422
fucking gay if you ask me
>>
>>103561410
Above your pay grade pytoddler
>>
>>103561438
cnile moment
>>
>>103561438
it's no gayer than blindly dereffing a null pointer. it's the same concept, but unlike NPE's monadic types enforce the contract by making you explicitly say, "yes, do as I say." instead of just doing it like a dumb nigger.

I strongly encourage you to read: "Learn You a Haskell for Great Good!" if you actually want to understand what Rust is trying to accomplish with its type system.
>>
>cnile
>pytoddler
>rustchad
>jeetscript
>clojure tranny

What's the catchy nickname for your language?
>>
>>103561469
I also want to point out, in this case. as I already said, since my use of binary_search_by is guaranteed to never succeed, I can safely unwrap it because it's objectively impossible to get an Ok() respond.
>>
>>103561469
>it's the same concept
wrong
dereffing a null pointer is UB
>>
>>103561485
depends on the language.
some languages have well defined, albeit useless answers to this question. Go for instance, the worst memory safety issue you can get is tearing interface types.
>>
>>103561469
fuck i've had that pdf sitting in my disk for so long bro and i just can't make myself care.
>>
>>103561410
it’s a way of getting around the “safe” type system by adding exceptions which allow it to arbitrarily be C whenever you want
>>
>>103561469
>read _why if you want to understand rust
The haskell tranny to rust tranny pipeline unveils itself
>>
>>103561469
>hey look at this new language i made
>in order to understand it you need to look at this other language i didn't make!
you're really selling it, keep going
>>
>>103561548
I'm not selling anything. Someone asked what unwrap is and I explained it and offered other material to learn more about it. It's very surface level book but after reading it you should have a good idea what a monad is and why rust has adopted a similar type system to Haskell's.
>>
these fucking programming puzzles have made me so autistic
i have become hyperaware of all disturbing noises; i want long periods of silence to think
i live in student accommodation near a primary school
during break or lunch or whatever hundreds of children simply scream nonstop
i wear earplugs all day now, should i buy a white noise machine too?
>>
made my solution even more idiomatic
>>
>>103561485
Wrong, dereferencing a pointer that might be null has no special syntax and can be difficult to debug in complex programs. unwrap means you explicitly declare you're doing an unsafe thing (tho it makes sense for AoC type programs).
>>
I think people who use a programming language with a paradigm that I don't like should be burned at the stake.
>>
how do you use union find for part 2?
>>
>>103561522
the haskell guys i knew back in like 2010 or so were typically fixed-gear bike hipsters or turbo goobers, though they were definitely smart.
i don't actually think any of them turned into rustfags, though.
the guys i know who turned into rustfags were all pytoddlers.
>>
>>103561640
when you join two sets you have to count down from the smaller set (by whatever heuristic: size, depth, etc.)
>>
>stack memory is a stack data structure
>heap memory has nothing to do with the heap data structure
>>
>>103561640
You keep track of sets of available tiles then unironically count down from your blocks. Once you can merge the start and end sets, you've found the target blocker.
>>
countdown tard was ahead of the curve
apologize
>>
File: codesnap4.png (308 KB, 1878x1584)
308 KB
308 KB PNG
easiest day 18 i've ever had on AoC
>>
>>103561612
wrong, unwrap is not unsafe, dumb retard
>>
>>103561697
apology accepted
>>
File: carbon(3).png (216 KB, 848x1280)
216 KB
216 KB PNG
readable Rust solution
>>
>>103561805
oxymoron
>>
>>103561805
>priorityqueue
nigger, just use a queue.
>>
>>103559846
turns out this O(n) solution will almost surely work.
the "random blocks" after the maze are picked in such a way that the first 400 or so will always avoid the last remaining solution.
>>
ngl bros I quit this after 10 days because it felt like a waste of time at that point
>>
>>103561846
filtered
>>
>>103561567
anc headphonse maybe?
>>
>>103561849
The puzzles are boring admit it
Most of us didn't drop out because of the difficulty
>>
>>103561909
I go back to solve the puzzle if the thread seems interesting if not I just skip the day
>>
>>103561909
Filtered
>>
>>103561922
>i look up the answer and then solve the puzzle
>>
>>103561849
>>103561969
drooling retards
>>
>>103561981
filtered
>>
>>103561888
i have noise cancelling earbuds which i use but they only last for 4 hours. is the noise cancelling in headphones as good as in earbuds?
>>
>>103561976
I'm not doing another generic grid problem #133435
The Christmas tree easter egg problem was the only trace of fun I got out of AOC this year the rest is just a waste of time
>>
>>103561998
Filtered
>>
>Well, you see, actually <stupid excuses>
F I L T E R E D
I
L
T
E
R
E
D
>>
File: GNUlag.jpg (334 KB, 1920x1080)
334 KB
334 KB JPG
no bigboy today?
>>
>>103561998
>nth grid problem of the year
>still somehow not good enough at grids to do them quickly
>spends his time crying about it on /aocg/ about how little fun he's having wasting lots of time with these very easy generic grid problems
shut up WHORE
dx = ((-1, 0), (0, +1), (+1, 0), (0, -1))
for dr, dc in dx:
...

wahhh it's so difficult; it will take me HOURS to implement bfs and binary search!
show tits before pretending to be this retarded again
>>
>>103562040
bigboy got filtered, we've entered late game
>>
>>103562040
there is >>103558888
>>
>>103562040
try checking the last thread, retard
>>
>>103562037
Strawman kys
look at the /g/ leaderboard there are people getting "filtered" on piss easy days. It was never about the difficulty
>>
>>103562073
>look at the /g/ leaderboard
>some /g/ users can't code
imagine my shock
>b- but oofmatoes-
shut up WHORE, he was using ChatGTA or something
>>
Just got back from an exam. How hard is today's puzzle?
>>
>>103562040
>>103562066
the solution for part 2 is 3163,4131. I just encoded it wrong( a*100+b)
time ./target/release/aoc_2024 < /tmp/bigboy/bigboy.txt
day18 result:(9998, 316304131)
./target/release/aoc_2024 < /tmp/bigboy/bigboy.txt 0.00s user 2.49s system 99% cpu 2.496 total
>>
File: img-2024-12-18-17-21-01.png (1.08 MB, 6016x2060)
1.08 MB
1.08 MB PNG
>>103562112
very easy
>>
>>103562073
>ummm actually I can solve it but I won't because it's too boring
>anyways I'm not filtered because I can solve it but I just chose not to
F I L T E R E D
I
L
T
E
R
E
D
>>
>>103562135
>yesterday was extreme
yes I agree
>>
>>103562101
has anyone found actual evidence or are we just assuming because he didn't get day 17 gold hence rage quitted or smth
>>
>>103562124
Did you put an aStar trap in here? Because my part is horrendously slow with Dijkstras on part 1, but switching from aStar to Dijkstras in the middle of part 2 cut down my time by 11 times.
>>
>>103562225
he hasn't posted proof that he is legit so I will assume he is not
that's just how it is in the current year
>>
>>103562248
well we do have his YouTube channel now. could drop a comment asking for a live stream
>>
>>103562225
He can prove himself by getting leaderboard times on a LLM filter day.
If not eh nothing personal better luck next time if I wronged you. No proof= no acknowledgement for you
>>
>>103562225
idk any people who can leaderboard that consistently but also think they can broot 200 trillion inputs

>>103562336
right, he's never done well on a day LLMs didn't do well
>>
>>103562360
>Mogs you with cuda
>>
>>103562371
Doesn't count if you don't broot on cpu
>>
File: bb_sample.png (202 KB, 2000x2000)
202 KB
202 KB PNG
>>103562246
nah, it's totally random. it's not the neat grid maze of the official input but just a random self-avoiding dfs. here is an image of a smaller sample.
import random
from collections import deque, defaultdict
from itertools import product

visited = {(0, 0)}

frontier = deque([(0, 0)])
dirs_ = [(-1, 0), (0, 1), (1, 0), (0, -1)]

SIZE = 100

indices = defaultdict(int)


def get_rng_list():
l = dirs_.copy()
random.shuffle(l)
return l


explore = defaultdict(get_rng_list)

while frontier:
x, y = frontier[-1]
i = indices[(x, y)]
if i > 3:
frontier.pop()
continue
random.shuffle(dirs_)

dx, dy = explore[(x, y)][i]
indices[(x, y)] += 1
nx, ny = x + dx, y + dy
if (nx, ny) not in visited:
if 0 <= nx < SIZE and 0 <= ny < SIZE:
is_valid = True
for ddx, ddy in product([-1, 0, 1], repeat=2):
if ddx == ddy == 0:
continue
if ddx * dx + ddy * dy < 0:
continue
is_valid &= (nx + ddx, ny + ddy) not in visited
if is_valid:
visited.add((nx, ny))
frontier.append((nx, ny))

all_coords = {*product(range(SIZE), range(SIZE))}

unvisited = [*(all_coords - visited)]

visited = [*visited]

random.shuffle(visited)
random.shuffle(unvisited)

print(len(unvisited))
coords = unvisited + visited

with open("/tmp/bigboy.txt", "w") as f:
for x, y in coords:
f.write("{},{}\n".format(x, y))
>>
This has been a bad year so far. Hopefully the last third makes up for it.
>>
>>103562135
>latest easy puzzle EVER (other than Christmas day puzzles)
fuuuuuck you eric
>>
>>103562225
In this day and age he's the one who needs to prove himself. You can't just say you beat a world record without proof and expect people to believe you.
The worst is assumed until proven otherwise because of how common LLMS are unfortunately. Tuff
>>
File: 1604874361342.gif (196 KB, 500x281)
196 KB
196 KB GIF
>have to start this day really late
>part 1 seems really easy, so part 2 hash to be extremely difficult
>get to part 2
>it's trivial
Huh?
>>
>>103562225
>have the ability to spend less than 10 minutes a day to get your name on a leaderboard and btfo thousands of people
>nah I just don't feel like it
Human brain doesn't work this way. Nobody would do this.
>>
>>103562246
a* should speed up part1 a lot for the bigboy, since there are only 1024 obstacles on a 5000x5000 grid.
>>
>>103562613
Not to mention if he was somehow legit, that would mean he has a shitton of aoc specific helper functions. Someone like that wouldn't just "lose interest" halfway through.
>>
>>103562620
Why would you use either A* or Dijkstra's? It's unweighted.
>>
>>103562620
What would the heuristic even be for a*. How close you are to the goal, so you check paths closer to the corner first? Isn't that basically just dfs then?
[Note: I have never done a*]
>>
>>103562676
dfs doesn't find the shortest path
>>
>>103562613
does he even care about the leaderboard though? LLM cheaters thusfar have consistently gotten at least top 100 in silver
>>
>>103562676
For me, square distance.
>>
>randomly goes offline for a few days
>lives rent free in the thread
how does he do it
>>
>>103562620
Yeah, it did. But with more obstacles my aStar got lost early and Dijkstras became better by an enormous margin. I do a binary search on part 2 and after a couple of iterations I switch from aStar to Dijkstras
>>
>>103562662
You never know what bullshit will turn up in part 2. By which point you already have dijkstra for part 1 so may as well use it.
>>
>>103562613
Maybe it's just me but I don't really give a shit about leaderboard placement
>>
>>103562662
Doesn't Dijkstra collapse to DFS anyway?
>>
>>103562868
>using words without knowing what they mean
>>
>>103562858
Do you have global points? If not, pf course you don't care. But if you could get global points, you would
>no i wouldnt
Yes, you would.
>>
>>103562868
DEI
EID
IDE
>>
>>103562868
It's closer to bfs. By a lot.
>>
>>103562898
Sorry but I did have breakfast this morning
>>
>>103562868
you can do dijkstra with any cost function as long as the cost does not decrease when the path gets longer. you could do "cost of path=-min(time at which node gets blocked)" so that you explore path options from "gets blocked the latest" downwards. so your solution will be optional in that respect, i.e. the one that gets blocked latest. see >>103560425
>>
>>103561419
um actually sweaty, unwrap is the comonadic identity
>>
>>103559822
>namefag
>tripfag
>innumeratefag
>>
>>103562725
What else are we supposed to do? Talk about day 18? It was a shit boring puzzle. If it was day 8 as the first djikstra problem it would have been fine. But it was day 18 two days after we had a more difficult pathfinding problem.
>>
>>103563033
>time at which node gets blocked

You mean the node's position in the input?
>>
>>103562916
>she needs her eID to log into her DEI IDE
>>
File: 1734547838051.jpg (50 KB, 1080x199)
50 KB
50 KB JPG
Apologize
>>
>>103563932
rip.
yeh and remember she probably earn 2-5x whatever you get
>>
>>103563932
>filtered on day 2
repeal the 19th; end women's suffering
>>
>>103563951
Actually it's infinity times at the moment. :^)
>>
Who else imported solution again with networkx?
>>
>>103563987
I should learn how to use networkx. I'm just worried that it would be difficult to solve more complex aoc problems with it. What happens if you want to traverse a graph in a specific way that is different than how networkx does it?
>>
>>103564039
Of course my fears are unwarranted as apparently Eric isn't going to give us a difficult puzzle this year.
>>
>>103564039
idk how to use networkx but i assume it's easier to simply implement e.g. dijkstra's yourself
you get your flexibility and you don't have to pipeline everything into a representation networkx will accept
of course you have to actually know dijkstra's, but you're not complexionally challenged, right anon?
>>
>dijkstra day
What the fuck is a dijkstra? I just did a BFS with a priority queue. BFS is so great you can do everything with it
>BFS day
DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA! DIJKSTRA!
>>
>>103564113
quite literally me: >>103559155
>>
>>103564113
dijkstra just werks :^)
>>
>>103564113
For me, it was because I already had my Dijkstra code from that day, so it was easier to just copy paste it rather than think about the problem.
>>
>>103564039
What alternative traversal method would you ever have to use? Networkx lets you create directed and undirected graphs with either single or parallel edges, which would pretty much cover most, if not all, situations where a graph is suitable. And you can apply custom weights and values to nodes and edges, and potentially use those to craft your own custom traversal algorithm if the problem ever required it.

For these particular grid problems that Eric loves, there's even a built-in method that generates the grid graph with connected neighbour nodes.

>>103564086
Networkx has a built-in Dijikstra function already.
>>
>>103564039
You can still traverse a networkx graph manually, and the dfs/bfs traversal functions take an ordering function as an argument
>>
If you used Dijkstra then you got filtered. Using another man's algorithm is cheating.
>>
>>103562135
Yesterday was indeed very easy but the leaderboard metric this graph uses is retarded.
>>
>>103564313
make a better one
>>
>>103564301
Every White man with an IQ greater than 130 has independently come up with Dijkstra's algorithm after a few minutes of thought.
>>
I'm using a 6 GHz Intel Core i9-14900K CPU. It has 8 performance cores and 16 efficiency cores with a total of 32 threads and 32 MB of L2 cache. It has a liquid cooler attached and is housed in a spacious, full-sized, Cooler Master HAF 700 computer case. I've come across videos on YouTube where people have managed to overclock the i9-14900KF to 9.1 GHz.

The system has 96 GB of DDR5 RAM clocked at 6,000 MT/s and a 5th-generation, Crucial T700 4 TB NVMe M.2 SSD which can read at speeds up to 12,400 MB/s. There is a heatsink on the SSD to help keep its temperature down. This is my system's C drive.

The system is powered by a 1,200-watt, fully modular, Corsair Power Supply and is sat on an ASRock Z790 Pro RS Motherboard.

I'm running Ubuntu 22 LTS via Microsoft's Ubuntu for Windows on Windows 11 Pro. In case you're wondering why I don't run a Linux-based desktop as my primary work environment, I'm still using an Nvidia GTX 1080 GPU which has better driver support on Windows and I use ArcGIS Pro from time to time which only supports Windows natively.

I'll use GCC 13.3.0 and a few other tools to help analyse the data in puzzle.
>>
>>103564287
>built-in dijkstra function
but dijkstra's is like short 12 lines of code
>>
>>103564370
do it in 12 lines in a none meme language
>>
>>103564315
I propose that we install a keylogger/screenlogger on every participant's machine, that can accurately detect exactly when they begin work on an AoC problem. This can more accurately track how long a participant is spending on a problem, unlike the default leaderboard ranking which just tracks the time since the problem was released and fails to account for timezones. It will also enable us to check when they are searching for solutions, which can indicate when they have been filtered. Additionally, we could also monitor their webcam and microphone, and analyse their facial expressions and recordings to measure their frustration at a given task.
>>
>>103564321
greater than 90 you mean
>>
>>103564370
That's 11 more lines than nx.shortest_path_length is
>>
>>103564370
And you can shorten that to 1 line of code.
>>
>>103564287
For example, the elephant valve problem in 2021. I'm not sure how I would have gotten my spaghetti to integrate into networkx. I'm sure it's possible but I'd rather do it myself
>>
File: file.png (259 KB, 6000x1200)
259 KB
259 KB PNG
We're so fucking back. These all have a different canvas size because I'm an idiot and kept forgetting to downscale the canvas to 1200x1200 instead of my default 2400x2400. At least it doesn't look that bad downscaled/upscaled I hope, but it might fuck things up when I try compiling them to a calendar
https://files.catbox.moe/gyr63y.png
https://files.catbox.moe/ndgfuo.png
https://files.catbox.moe/28iiy8.png
https://files.catbox.moe/iu6uu5.png
https://files.catbox.moe/aq0eo7.png
>>
>>103564447
>he returns
I'm sorry for doubting you. I kneel
>>
Reimplemented with BFS instead of Dijkstra... same runtime. They're basically identical for this problem.
>>
>>103564402
d = [math.inf * n], u = [False] * n
d[0] = 0
for i in range(n):
v = -1
for j in range(n):
if not u[j] and (v == -1 or d[j] < d[v]):
v = j
u[v] = True
for edge in adj[v]:
to, len = edge
if d[v] + len < d[to]:
d[to] = d[v] + len
>>
>>103564447
you and calendar-anon are my fav
>>
>>103564447
The post that saved /aocg/
>>
>>103562613
dunno about that, /ourguy/ was literally a top contender for rank 1 but stopped doing aoc because he didn’t like staying up late
>>
>>103564113
the maze basically forces the bfs down the correct path anyway without the priority queue bottleneck
>>
>>103563932
imagine being filtered on day 2 or 4
>>
>>103564447
Your posts are the highlight of these threads
>>
>>103564447
YESSSSS
>>
>>103559842
This is what stable diffusion and other AIs would generate when you asked for a "photo of computer code" before they figured out proper language forms and grammar.
Rust is a language with only syntax and no meaning, just like AI shit
>>
>>103564447
based drawfag
>>
>if you have the min distances for some set of nodes, the closest node outside that set is itself a min distance (assuming no distances are negative)

How did a Dutch guy get his name attached to something so self-evident?
>>
>>103564828
well, niggers wouldn't figure it out, so why not a dutch guy?
>>
>>103564828
Its like physics laws, where rich aristocrats in the 1700s got to have common sense things named after them just because they formalized it.
>>
Is Eric just saving his nuclear bombs for the last week or what?
>>
>>103564957
There are no nuclear bombs. This is an anniversary celebration, and the last AoC. Eric wanted as many people to reach the end as possilble. Its a victory lap.
>>
>>103564957
Eric is a paper tiger
>>
>>103565012
No you don't understand, Eric's gonna launch the nukes irl and put everyone in this shitty world out of their misery
>>
>>103565012
>last AoC
where did this rumor come from?
>>
>>103565062
it was on the AoC++ blogpost he made leading up to day 1
>>
>>103565062
he's getting old... ten years is a good milestone to end it on. he made no attempt to make the puzzles LLM-resistant because he doesn't care anymore; it's over.
>>
>>103565012
>Eric wanted as many people to reach the end as possilble
we are down to 9% of participants by day 18 thoughever
>>
>>103565088
christmas tree robots were a pretty good attempt
>>
>>103565062
Pure speculation that some people decided to run with. There is no actual evidence.
>>
>>103565062
>Theme of the event is revisiting all locations in previous AOCs
>Puzzles are significantly easier on average
>No attempt to make the problems LLM resistant
I don't personally buy it myself but there's plenty for people to be worried about
>>
>>103565111
he said on twitter he made no attempt to do so
you could similarly argue some of his pre-LLM puzzles were designed to be resistant, and i would call you a based retard
>>
>be me
>last night
>finish puzzle quick
>go to sleep
>dream about aoc
>trying to bugfix something in my dream
>make a small change and run program
>suddenly a car alarm starts going off outside
>panic thinking I messed up my program so badly alarms were starting to sound
>wake up because of the car alarm
it was a strange experience waking up fully and realizing what had actually happened
>>
>>103565126
The man is tired, people are tired, shit is gonna hit the fan, and your ass will be sacrificed for greater Israel. Simple as.
>>
>>103564447
kino, absolute kino
>>
>>103565182
i believe your story because similar shit happened to me
this is what people mean by dreaming in code
wear earplugs to sleep through noise like car alarms in the future

i once had a dream where i had to optimise the placement of boxes by some nebulous metric;
i was convinced i had to do this task in order to fall asleep... i got so frustrated that i woke up
>>
File: 1573554887429m.jpg (111 KB, 1024x682)
111 KB
111 KB JPG
>Went to bed but got woke up by a kid.
>Since I’m up skim part 1 before going back to sleep.
>Absolutely convinced p2 will have something to do with tiles falling, moving, expiring.
>think about optimal way to handle these things for a while
>Wake up and see part 2
>>
>Dijkstra
BFS with priority queue
>DFS
BFS with a stack
>Floodfill
basically BFS
>cycle detection
can be done with BFS
>Ford-Fulkerson
implemented with BFS

also,
>guaranteed to find shortest path first, if it exists
>no recursion depth limit or stack overflow issues
>can find distances to all other nodes efficiently

BFS is all you need
>>
File: day17-mathematica.png (214 KB, 1245x2387)
214 KB
214 KB PNG
I have returned from the dead. Technically "filtered" but I should be able to roam around for the rest of the challenge as a zombie.
>>
File: day18-mathematica.png (94 KB, 1232x1217)
94 KB
94 KB PNG
And day 18.
>>
>>103565264
>wear earplugs to sleep through noise like car alarms in the future
What about fire/CO alarms?
>>
File: tgf.png (909 KB, 2039x2117)
909 KB
909 KB PNG
>>
>>103565481
if you die you die; residential fire alarms are ~85dB, so minus ~20 dB from the earplugs they would still be ~65dB
i'm a light sleeper, so i'm moderately confident i'll wake up to a fire alarm
my bedroom door is also a fire door, so i have more time anyway
>>
>>103565534
It's over for me tomorrow.
>>
>>103565534
>large filters at day 6 and 12
18 was very easy. But we are due for a big filter.
>>
>>103565405
> BFS
> Brute-Force Solution
brootbros...
>>
>>103565617
if you think about it, most brute force solutions are unironically just bfs. sometimes dfs.
>>
>>103565405
Shut the computer science departments down... they know.
>>
File: im-43a3a114a8.jpg (43 KB, 465x488)
43 KB
43 KB JPG
>>103565419
we won’t rat you out anon glad you’re here
>>
>>103565419
as far as I know there are 2 active filteranons with different criteria. You will show as filtered for one of them.
>>
>>103565667
It's too late >>103557800
I deserve it for the name, but it was by the clock, I swear.
>>
>>103565702
I have previously argued that if you're filtered that's it, so I'll hold myself to that standard.
>>
Have any fa/g/s ever tried making their own puzzle?
>>
>>103565743
yes, hopefully dropping on day 26 if we can get the site working
>>
>>103565405
How do you find all paths between 2 points with BFS?
>>
>>103565743
D18, but after every step a new byte falls. You start at the last step it is possible to find a path and you need to find the shortest path's length.
>>
>>103565809
Not him, but that's just modified Dijkstra, so he'll say it's all BFS.
>>
>>103565743
2019d2, but there are 50 million instructions and it's called floatcode
>>
>>103565809
Keep track of the predecessor (the node where you came from) of each node during BFS. If there are multiple paths, just keep a list of predecessors for each node.
>>
File: carbon(142).png (1.1 MB, 1292x7670)
1.1 MB
1.1 MB PNG
any other manual binary search chads?
[root@milkv-duo]~/2024# wc -l input_18.txt
3450 input_18.txt
[root@milkv-duo]~/2024# ./day18
-1
[root@milkv-duo]~/2024# ./day18
648
[root@milkv-duo]~/2024# ./day18
648
[root@milkv-duo]~/2024# ./day18
648
[root@milkv-duo]~/2024# ./day18
-1
[root@milkv-duo]~/2024# ./day18
-1
[root@milkv-duo]~/2024# ./day18
-1
[root@milkv-duo]~/2024# ./day18
648
[root@milkv-duo]~/2024# ./day18
648
[root@milkv-duo]~/2024# ./day18
648
[root@milkv-duo]~/2024# ./day18
648
[root@milkv-duo]~/2024# ./day18
648
[root@milkv-duo]~/2024# ./day18
648
[root@milkv-duo]~/2024# ./day18
-1
[root@milkv-duo]~/2024# ./day18
8,51
-1
>>
>>103565743
Occasionally a problem gets posted that catches the attention of /g/, but it's rare and can't really be forced. Difficult balance between being low time investment and having interesting results.
Not a puzzle per se, but one of my favourites was a challenge years ago to implement a crude image filter by random placement of circles (and other shapes). Spanned a few threads and spawned dozens of neat approaches with many cool images.
>>
>>103565928
Leaking AoC++ challenges is strictly against the rules. Please delete your comment from here and scrub any other mentions of this challenge from any social media account. If you have even told this to a friend, immediately exterminate them.
t. daggerdragon
>>
>>103564503
that's a meme language, anon
>>
>>103565419
>>103565440
based
>>
>>103566052
list non-meme languages
>>
>>103565534
>filtered only because I forgot about day 1
feelsbadman
>>
>>103565617
>DFS
Double-brute Force Solution
>>
>>103561688
This is a very inelegant solution.
>>
>>103566075
>english
>8086 asm

you don't NEED more
>>
>>103565182
>>103565264
>Dreaming about coding
I always have a bad sleep when this happens. It's like my brain is unironically spending resources trying to solve a problem it made up, and I wake up feeling like I never slept at all.
>>
>>103565948
I know about the predecessor trick to reconstruct a single path and I guess that keeping track of a list of nodes predecessor nodes is all the information you need but I'm blocking on what do you have to do to list or counts all the paths. The difficulty is path joining and merging. I'm wondering if you need use a DFS/backtracking for listing/counting all the paths or if there is a more efficient way.
>>
>>103566169
>my brain is unironically spending resources trying to solve a problem
correct, you actually accumulate sleep debt while dreaming
in fact, if you suppress rem sleep long enough you will dream while awake, even with 8 hours of deep sleep
>>
File: d18.webm (205 KB, 568x568)
205 KB
205 KB WEBM
More visualizations.
>>
I'm already filtered, but can someone give me a (fairly strong) hint on D17 Part 2, please?
>>
>>103566286
Find A that will give you the last nmber, find A that will give you two last numbers, try to see a pattern here.
>>
>>103566305
Can you dumb the logic behind this idea down as if you're explaining it to a semi-retarded labradoodle?
>>
>>103566286
The program's 8 instructions long, work out what it's doing on a bit of paper first.
>>
>>103566286
if you write out what the instructions are doing you will see that the code essentially takes the last 3 bits of A, manipulates them to get the output, then divides A by 8 (aka shifts the bits by 3). So each three bits of A roughly corresponds to an output number.
>>
>>103566315
Multiply A by 8 for each next add loop over possible remainders.
>>
when did hiromoot kill the ip counter and why? any anon know?
>t. still here for aoc but mostly skim r/greentext now pls forgive
>>
>>103566331
I fucked up my words, but you got the point.
>>
>>103566286
- on each step you pop the last 3 bits from A
- B and C are temporary registers
- the answer is 48 bits; a bad day for brootchads

dfs in reverse to a depth of 16; try all 8 possible permutations of 3 bits and dfs `A << 3 | bits` if the output matches the reversed program at that depth
>>
>>103566216
For the predecessors, you can also keep track of the direction you entered each node. Then you can reconstruct all the paths (with BFS!) from the end node .
That's what I did for day 16 part 2.
>>
>>103566320
>>103566331
So, just to check that I'm understanding correctly. We start with A = 2024. We bit shift to the left by 3. However. this only gives an approximate range to work in. I assume I'd need to then check around this range more closely (i.e., for loop with increments of one); but how do I know when this for loop should stop and I should shift left by 3 bits again?
>>
>>103566216
What i did is if the lengths were equal, I kept a list of both predecessors instead of replacing the predicessor
>>
File: day18.png (52 KB, 1161x1271)
52 KB
52 KB PNG
>>103565440
I went for a much sillier way of constructing the graph.
>>
>>103566286
If you have an A that gives you [n1] it means that to get [n2, n1] you need A*8 + rem.
Note that there are more than one A for each [nn ... n1] and not all of them have a valid A*8 + rem for [n(n+1), nn .. n1], so you will need to keep track of all possibilities.
>>
>>103566369
When you get the correct output
>>
>>103566413
>>103566421
Ah wait, I think I get it.

I shift A by 3 bits. Then increment A by 1 until the first (last?) digit matches. Then shift by 3 bits again, and repeat until all match? That's genius.
>>
>>103566445
Last
>>
File: aoc_2024_18_b.png (1.01 MB, 2022x5606)
1.01 MB
1.01 MB PNG
Also, I may already be filtered, but here's D18 anyway.
>>
>>103566445
Also if you are using javascript there is a catch.
>>
>>103566466
Thanks!
>>
>>103566475
Nah, Python. Big numbers won't be a problem.
>>
File: day18_durga.png (1.3 MB, 981x2205)
1.3 MB
1.3 MB PNG
>>103559842
I copypasted my day 16 djikstra for part 1 and wrote a Durgasoft tier bruteforce for part 2.
>>
>>103566445
If you look at the output assembly for your program you can see thats what its doing. for bitshift noobs.
15 % 8 == 0b1111 & 0b111 == 0b111 == 7
15 // 8 == 0b1111 >> 3 == 0b1 == 1


the final big spoiler is you are building up a number by bit shifting so you have to do it in reverse this is why:
7 == 0b111
7 << 3 == 56 == 0b111000
56 | 7 == 64 == 0b111111
>>
boggles me how aoc started 9 years ago but we're already on the 10th edition
>>
off by one
>>
>works on example
>doesn't work on input
I'm too tired for this shit..
>>
>>103565405
>>103566357
>with BFS!
you know, when you think about it, natural selection works in a concurrent BFS manner.
you've got a population reproducing, recombining their genomes in all sorts of directions and a fraction of these organisms will be more adapted to live in the current or nearby ecological niche
>>
>>103566286
A becomes A / 8 by the end of every loop. Therefore your initial range for A given output length n is
 8 ** (n - 1) <= A < 8 ** n 
and your range for A on the last loop is
 1 <= A < 8 
since A = 0 ends the program. Work backwards.
>>
>>103566661
This reminds me that we do not have any cellular automata problems so far, those are always fun
>>
>>103566647
>off by one
Fuck you Eric you said 70 not 71 AAAAAAAAAAAAAAA
>>
>>103559822
>put the title in the name field award
>>
>>103566075
C99
>>
>>103566712
70 inclusive
>>
File: 2590311.jpg (644 KB, 2048x1807)
644 KB
644 KB JPG
straight distra? easy squeezy!
>>
>>103565963
Based
>>
see grid, import heapq
simple as
>>
>>103566712
example should have caught this?
>>
Eric knows there are interesting ways to do pathfinding problems without a 2D grid, right? Powerlines are a common example for node graphs... powerlines are like Christmas lights...
>>
I thought part 2 was going to be that each step that passed more walls would fall into the maze and prepared for that, but it ended up being brute forceable.
Well I at least made a slightly better search method, idk if there is a name for this kind of search
>i == 1000
>first = 0
>for j=first; ; j+=i
>if can_complete_with_first_j_walls(j) then
>if i == 1 return j; end--if
>first = j - i
>i %= 10
>end-if
>end loop
>>
>>103566890
he knows people have grid libraries prepared, will make neat visualizations, etc. The event's evolved in response to community feedback and mostly reddit complaints, which are mostly about too-low difficulty:
>I was able to brute this and didn't have to learn the lesson :(
>I was spoiled by your wikipedia link, I wanted to rediscover the concept of 'addition' myself
>>
Okay, so what was the intended solution for yesterday? What I ended up doing was
>run a bunch of examples
>notice it almost looks like it is counting
>adjust parameters to find around where the output starts to be the right number of digits
>loop starting from there jumping up by millions each loop
>the last k digits of the desired output and the current output is counted
>if it is a new best k, reduce the amount you jump by each loop
So basically a hackish way to search the outputspace, but it worked
>>
>>103566999
The operation performed on the A register is a bitshift to the right of 3 digits. You can reverse this, but since each shift wiped out 3 bits (a number from 0 to 7) you have to branch your search across those 8 possibilities.

My first retard attempt was to calculate the periods of each digit (it’s 1024 for the first, and then goes up by 8 each time).
>>
>>103566890
Sorry, now that you have written this he can't use the idea without paying you $150k.
He's going to stick with the same patent-unencumbered problems until AoC finally folds (hopefully this year).
>>
>>103566890
He also avoids doing anything that would need non-integers, so everything ends up slotted into a neat grid. I think there's been one problem throughout the whole of AoC where I've used a non-integer numeric type (2019 day 10 part 2), and I expect there's a way to do it without them anyway.
>>
>>103567096
We’ll still have Advent of /g/.
>>
>>103566972
>which are mostly about too-low difficulty:
isn't it easier now though? The one other time I did AoC around this day was some insane problem where you had to triangulate boats or something like that
>>
>>103567114
I'll make the logo!
>>
>>103567114
25 anons make up one problem each. Might be cute.
>>
>>103567175
I volunteer for the parsing problem
>>
>>103567175
There aren't even 25 anons left by the end of a normal /aocg/.
>>
>>103567175
Could be fun. We should cooperate and create an alternative AoC for the next year. How do you think we should organize it?
>>
>>103567266
yeah its just me talking to myself
>>
>>103567295
I’m in brehs maybe he will open source the code so we can host an alternate version of the full site
>>
>>103567344
I don't care about it looking something like AoC or leaderboard shit, just creating a 25 problems in 2 parts and posting them here would be fine.
>>
>>103567087
>bitshift
yeah fuck that shit glad I sem-bruted instead
>>
>>103567344
It's just basic auth and a simple API for inputs/solutions. Anyone could make an alternative if needed.
>>103567368
True.
>>
>>103566890
if you for even a second thinks that god king eric considers the likes of (You), you are severely delusional
>>
>>103567368
Yeah, we don't even need a site. Just a puzzle and a "You should be able to solve this!" image is enough to make /g/ autists participate. The only reason to have a website is the excuse to license it AGPL+Nigger
>>
>swap x,y into r,c
>forget to swap back for submission
classic
>>
>>103567538
>>103567368
To think of it, we might actually need a site, since second part being revealed only after the first one is solved is part of AoC's charm.
>>
Since Eric is suddenly so very concerned about intellectual property, instructing his reddit mods to complain about anyone that has even old inputs in their repo, I think he's gearing up for a sale. Some Jeet will buy up AOC and charge for access to previous puzzles and try to monetize it in every way possible.
>>
This day was easy, but the bigboy was brutal until I realized that my solution got much more effective by simply counting down.
>>
>>103567538
>>103567558
An organized set of 25 puzzles posted would still be fun. It's better to have a site than to not, because of the part 2 reveal and because the site checks whether your solution is correct for you.
>>
I hope the site doesn't fold too soon because I've got a modest backlog of previous puzzles to beat.
>>
>>103567576
jeets aren't even so brazen man i guarantee it'd just be some grind-mentality hypeboi tech-adjacent faggot from an ivy league / stanford
>>
>>103567622
If he does drop the site, I'm sure he'll give some notice. In the mean time though, backup the ones you haven't solved just in case. I'm going through and saving each puzzle page, just in case if I ever want to go back to some previous year, I don't need need to buy access from TATABrahminDurga Group.
>>
You know what'd be cool, if there was something like AoC but instead of having solutions it was all optimization problems and you played it like golf
>>
>>103567699
I'd prefer building something.
But maybe have 2 leagues:
>Formula 1 (finish first)
>Paris-Dakar (finish at all)
>>
>>103567699
I'm sorry anon but that's a terrible idea. I can count on my dicks how many decent programmers this board has
>>
>>103567661
>backup the ones you haven't solved just in case
that's why I have to hurry. I need to solve part 01 to be able to save part 2 assignment
>>
>>103566616
fucking elves, man
>>
>>103567783
If he is quitting, I'd only bet on a month after the 25th before he shuts it down. And since he's sperging about IP, there's no chance he's just going to open source it and dump the previous challenges on github.
>>
AoC but the story has increasingly unsubtle hints about (((gremlins))) ruining Christmas
>>
>>103567840
i wonder how much money he makes from the AOC++ and sponsorships every year
>>
>>103565049
keyed
>>
>>103567863
40 - 50k would be my guess. He has said in the past that it occupies a large chunk of his year, so it's probably not the best value for his time.
>>
Parsing/toy language problems are fun, the problem is coming up with a question that has an objective numerical solution (beyond "compute this input")
>>
>>103567840
All he's said is he'd appreciate that there isn't an organized effort to gather every input for every problem. It's the reddit jannies sperging about IP.
>>
>>103567924
He opened an issue on one of the llmfag repos asking for the inputs to be removed, and it looks like it got a DMCA takedown
https://github.com/hugoromerorico/advent-of-code-24/issues/11
Maybe someone has a screencap of the comment he posted
>>
File: bqn.png (3 KB, 139x85)
3 KB
3 KB PNG
>>103566616
your language doesn't have a span operator and it shows
>>
File: 1734569117425.png (442 KB, 1324x2047)
442 KB
442 KB PNG
>binary search based on brute force
also glad I pulled my day 16 into a generic start+neighbours interface
>>
>>103567699
It's hard to measure, is the issue with that. Everyone is using a different computer + feels bad to do that to our poor pythoncels.
>>
>>103567699
Isn't this leetcode? It's rarely just "find X" it's "can this data be sorted in n operations" or something.
>>
>>103566616
And unless you're a communist, we don't have a year zero. Nothing hurts the programmer brain more than an off-by-one.
>>
>>103565481
wasabi fire alarms
>>
>>103567776
how many dicks do you have
>>
File: aoc_2024_18.png (102 KB, 668x1609)
102 KB
102 KB PNG
Perl. Quite straightforward.
>>
>>103568037
there is a year zero of AoC though
>>
>>103566712
>grid starts at 0,0 and goes to 70,70
>>
File: day18_swift.png (423 KB, 1750x1974)
423 KB
423 KB PNG
Defining a Point struct with helper methods last week continues to pay dividends.
>>
>>103567699
would something like this work?
>create a new language, /g/code
>you have to write your solution to any optimization problem in /g/code
>your execution time score isn't measured by literally how fast your program runs, but is instead based on /g/time
>every instruction in /g/code has a specific and predetermined /g/time
>assigning a value to a variable only costs 1 /g/time, for example
>more complicated instructions, like sorting a list, costs n /g/time, where n was the amount of comparisons it took to sort the list
>not to mention the /g/time costs of the comparisons themselves
>every /g/code program will have the exact same amount of /g/time for every user, so you don't have to worry about different hardware and language specifications ( >>103568013 )
>two separate leaderboard categories for single-thread solutions and multi-threading solutions
>>
>>103568350
Let's learn to count...
1 2015
2 2016
3 2017
4 2018
5 2019
6 2020
7 2021
8 2022
9 2023
10 2024
>>
I created a form for your alternative AoC puzzles.
If here will be at least some puzzles I will build a site by 25.12.2025.
https://forms.gle/7f8849M1LLF8ZeAF6
>>
>>103568494
It's going in a very different direction, because a lot of people are doing AoC to practice a new language or to get better at the language they actually use, not to learn a toy language. It's still cool though.

Instead of /g/code maybe just use a classic assembly language like 6502 (NES). Easy to emulate and the spec is short.
>>
>>103568559
* by 01.12.2025, sorry
>>
>>103568559
I'll make sure to send an input generator that secretly evaluates rm -rf, just for (You) anon
>>
>>103568559
>>103568586
I suck at thinking of puzzles. I can only solve them. Good luck anon.
>>
NEW THREAD
>>103568820
>>103568820
>>103568820



[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.