#advent-of-code
1 messages · Page 49 of 1
vs e.g. the folding question, which was much quicker to read, and still led to needing an insightful solution (for the second part)
I couldn't agree more. in fact, I like that it has complex instructions and prompts that actually require carefully analyzing the questions, so that it feels like an actual working environment or something like that. plus, reading is a part of the fun, as demonstrated by the lovely creator of http://adventofrealizingicantread.com
.aoc unsubscribe
Okay! You have been unsubscribed from notifications about new Advent of Code tasks.
.aoc lb
:x: Please use #aoc-bot-commands for aoc commands instead.
FINALLY finished day 15, that one really kicked by butt
.aoc c
Day 17 starts <t:1639717200:R>.
30 seconds
gl
<@&518565788744024082> Good morning! Day 17 is ready to be attempted. View it online now at https://adventofcode.com/2021/day/17. Good luck!
oops
second
gl
everyone except for me apparently
i have no idea how to begin
physics
it's your ||cartesian ||whatnots
this is cute
wtf
gravity stuff
I've just finished reading this and I feel like this can just be solved on paper
∑
this is a very ∑ moment
yknow what this was fun but im gonna put this as a "do after a night of sleep" thing
I really wish I knew how to read
looks more like cobra
How do I know the velocity?
Ohhh I get it now
(6,4) means it moves 6 right 4 left, then it turns into (5,3) (4,2) and so on
I thought we had to work out m/s or sum shit lmao
oh no... I- I did...

i agree, the program anaconda is just as annoying as a real one
could someone help me with day 5 part 2 I get the correct answer with the example but not the actual puzzle data
please ping if you can help
Again I make my opinion of "python is slow of aoc"
@eternal shale #❓|how-to-get-help
Python 2 ??
and what is that os
on the way back it would not hit the target area
it's not continuous time

yeah but it can skip over the entire box in 1 unit of tim
if the velocity is too high
when would it ever skip over it

it'd literally go right until exactly above it and go up billions of units
then slowly drop back down
oh.
you mean cause y always increases
I see
this example:
x = 0
y = 0
vy = -100
target area is from (-1,-1) -> (1,-2)
you'd just straight from y=0 to y=-100 and never be in the box
.aoc subscribe
Okay! You have been subscribed to notifications about new Advent of Code tasks. You can run .adventofcode unsubscribe to disable them again for you.
.aoc join
.aoc unsubscribe
Okay! You have been unsubscribed from notifications about new Advent of Code tasks.
.aoc subscribe
Okay! You have been subscribed to notifications about new Advent of Code tasks. You can run .adventofcode unsubscribe to disable them again for you.
currently i have no approach other than brute force, which I assume is too inefficient for the input size
the puzzles are getting spicy
i used brute force and it worked
just like a minute runtime
it's alright lol, mistakes happen
a minute? weird, mine finished in 0.2s
the timing can be significantly brought down based on your implementation and language. Last I saw was a 9.75 microsecond time
Different build structure
i have honestly no idea what i can do for this other than ||bruteforcing||, like if i can just ||make an efficient enough function that goes through every x and y -100 through 100 and test that out|| then i think it could work?
There's some discussion on #advent-of-code-spoilers-archive if you're interested in a better way
but even with brute forcing ||you can be smart about which values you check by doing some math||
oh yeah absolutely, im gonna consider that too
I did days 1 and 2.
Now I need to finish the rest and catch up!
I feel so behind haha.
good luck! And don't worry about it, the most important thing is learning along the way
let me guess ||you used brute force 💪 ||
||and it worked??????||
I did so and fully expected it to
.aoc unsubscribe
Okay! You have been unsubscribed from notifications about new Advent of Code tasks.
i kind of feel like today's puzzle can be done mostly with pencil and paper... maybe I'm wrong though
||part 1 definitely can||
actually yeah that prob doesn't work
||so could part 2 if you're really patient. And have a lot of paper :D||
i actually just did part 1 in my head lol... no pencil or paper
first time I've ever seen an AoC like that
I needed paper to twig the concept
||for bruteforcing it just took me 30 secs per run lol||
with code?
ye
||mind you, per run PER part||
||3:30 mins, 3 mins to add the change and run it twice||
||For Day 17 that is super slow to take 30 secs||
||my CPU is slow and i used a range of 0 to 1000 for dx and -500 to 500 in dy||
||all you can do is minimize the randomized bruteforce range||
||to some mere two digit number iirc someone did that in subreddit||
||i know||
||hm||
||lol||
this is quickly become Advent of REDACTED again 🙂
||I would say it's worth knowing how to do part 1 properly||
||Part 2 on the other hand - yeah, I did a brute force just with minimum ranges of x and y calculated beforehand||
||\👌||
😄
are we speaking morse code in here or what lol
||-. --- / .-- . .----. .-. . / -. --- -||
Any helpful advice for day 16? Mind is pretty boggled at this moment
I'll ping you in the spoilers channel
Thanks
Done for today 🤘
nice
Trick shot visualization!
:O
holy moly 😮
Woah
niiice
Might finally have the energy to try AoC again. Had a final yesterday and wound up sleeping for about 14 hours 🤣
I guess I was tired
absolutely sick
okay, gonna clean up yesterday's solution and then it'll be time for day 17
wonder what awaits me today
i wonder how many days i can string together to make a submarine game
gonna bonk lantern fish with drones
that will be insanely cool
that would probably be too crowded on a terminal, but this has been a great way to debug my library
||okay perhaps i could use quadratic functions to solve d17? (or maybe just brute force lmao)||
||i just bruteforced, it took 5-10 seconds or so||
||I didn't use quadratics. I used brute force, but with well-bounded limits. it took about .5sec||
||call it grid search not brute force 😎 ||
seben
Day 18 starts <t:1639803600:R>.
I wonder if the ||pathfinding|| day was just a fake peak, and this weekend will be the real challenge
i bet it was real peak
this weekend is traditionally the hardest 👀
gl
what about sunday smh
<@&518565788744024082> Good morning! Day 18 is ready to be attempted. View it online now at https://adventofcode.com/2021/day/18. Good luck!
oops
No!

Woo weird math
i did thing lyk this once took me maybe 6 hours
the burnt-out urge to ||parse this as a string and not as a list|| because ||im too lazy to add depth checking and i know how that ended up last time||
havent finished it yet and i dont plan on solving it today but thats how id do it
also has anyone bothered to like graph the length of the questions as the days progress lmao
too much artificial difficulty on this one. I can't be asked to parse this shit rn
amen
if it's late and the problem is too difficult i just start it the morning after
I thought of a nicer way to do this than ||nested lists|| if anyone wants to know
At least in my eyes i would prefer it over the depth of a nested list
i just woke up... 😭
i dont feel like doing it rn
ouch
me not understanding anything in this question 😔
I keep getting this for the bigger example, but all the smaller ones seem to work on their own. Anyone got any ideas?
[[[0, [4, 5]], [0, 0]], [[[4, 5], [2, 6]], [9, 5]]]
+ [7, [[[3, 7], [4, 3]], [[6, 3], [8, 8]]]]
= [[[[7, 8], [5, 0]], [[0, 7], [6, 0]]], [[[8, 0], [9, 9]], [[0, 7], [0, 8]]]]
Hey folks - I wonder if someone can help me talk something through - I'm new at programming in general, and I'm wondering if what I am thinking will work.
I'm on the second challenge of day 1.
And to get the sums, in the sliding window, I am wondering if I can somehow write a recursive function that would take in the length of the list, then sum the first 3 index positions, and then subtract 3 from the length of the list, and call itself with the new length, repeating until the length reaches less than 3
I know it might be overcomplicating things - but I'm learning and hard is a good way to learn, no?
if you subtract the first 3 index positions, and then subtract 3 from the length and call it again, it will once again do the same thing ( subtract the first three index positions), so you wont be getting any progress
I forgot to mention, I was going to pop the first index position out each run
yeah then u dont really need the length of the list
just recursive call it with the new list
How do I get it to stop when there are less than 3 items left in the list
Oh wait
nm
if len(list) == 3:
dont pop
👍
Sometimes just writing my questions into discord, helps me figure things out haha - I should just keep sublime open, and type out my questions in there, noodle them a bit, then come on here and ask after.
good idea
idk if it still helps but ||make certain all the explodes happen before all the splits, on both left and right of pairs. This was my problem for like 45min because splits on the left were happening before explodes on the right.||
https://paste.pythondiscord.com/ozorigawem.lua
why does the .py find the nums.txt file but the .exe doesnt find it
( pls ping me )
I always have problems with .exe
and currently my code correctly parses all the examples and gives the right answer but gives the wrong answer on my real input
are you padding every letter to 4 bits?
make sure you;re not storing 6 as "110" for example
i guess that would show up in examples
yeah
i will paste my code here
should i dm you the code then
sure go ahead
hey guys can anyone help me with advent of code day 16 part 1
poste it using !paste in #advent-of-code-spoilers-archive
have you asked for advice in the spoilers channel? It's the place for help.
nevermind figured it out @rancid creek
Thanks! I did figure out the issue after debugging for an hour, turns out I had ||copied a self.left and forgot to change it to self.right||
Some instructions for operator packets on Day 16 aren't clear to me:
- the example with length type ID 0: Why is part A 11 bits long and part B 16 bits. I know the total is 27, but how do they split?
- the example with length type ID 1: since it doesn't specify, is every sub-packet always 11 bits long?
the packets have a recursive nature to them, you don't know how long each subpacket is until you read it.
ohhh... so every sub-packet can be a literal or operator ... so the sub-packets would start with version and ID again ?
We have another essay today 😆
yes
so for yesterday
it seems like there is ||a quite simple mathematical|| solution
is that worth exploring for part two lol
worth I'd say, it can get quite efficient
||From what I understand there's a way to reduce the bounds for part 2, but you can't just solve it outright like with part 1||
you can look into ways that ||don't require simulating the projectile, but still require a loop or two||
||parse string > making tree hehehe||
Honestly might've been easier
okay, my to-do list for today:
d17 appetizer
d18 main course (one of the hardest problems of the entire aoc)
d15 dessert
gl on that
day 18 seems hard to me but idk
maybe I'm just slow
I'm stuck on something

whoknows what
Something is definitely wrong though
oh no it's not just you, usually d18 and d19 are when the hardest puzzles are released
is there like a leaderboard for AoC, so i see which implementation is the fastest?
I'm like actually convinced one part of this day 18 part 1 is 10000000x easier if I just do it as a string instead of my whatever
not that I know of, but people are talking about bigger inputs and efficient solutions in this reddit thread https://www.reddit.com/r/adventofcode/comments/r9s5pz/2021_big_inputs_for_advent_of_code_2021_puzzles/
tag @muted aurora since I asked about this a few days ago
meh
idc about bigger inputs
i was curious about optimized solutions
performance
well, to process bigger inputs in a reasonable amount of time you need faster solutions
It's easier to measure the performance of a solution with larger inputs.
sure, but implementation may need to be changed if you're working with non dynamic structures
which very much may be the case if you're optimizing
My naive solution solves part 2 in ~150 ms, if I change something and run it again, it's hard to know if any measured difference comes from the change I made or any confounding system factors.
150ms is huge
huh, that's really fast, is that in Python?
No, Rust.
ah, that explains it
C++ solutions for 2020 were in microseconds https://github.com/Voltara/advent2020-fast
Those were different problems.
And like I said, this is my naive solution.
The point is that it's easier to distinguish performance improvements with longer runtimes.
again, yes, but it also may change implementation
which takes away from original challenge
at that point you're implementing your own solution for your own problem
What type of properties of the input do you have in mind that would significantly change the type of implementation you would choose?
an example is the lanternfish day, where the matrix solution was slower for 80/256 days, but for 1mm+ days it was vastly faster
Well, fair enough.
this for example, this can easily fit in a static array of 10 by 10 char
Still fun, though.
(C char, otherwise uint8)
Right
day 11
I see what you're saying
so no need to bring in list into the story
and keep allocating
(which'd be dynamic)
Question - for day 18 - if there are multiple pairs to explode, but exploding causes a pair to split - do I ensure I split all the pairs before doing anything else?
coding explode and split isn't so bad but order of operations is killing me here
||You always apply all possible explodes before you try a split||
||Then after you've done a split, you again try as many explodes as possible before trying another split||
right - that's what I thought - yet for some reason can't get the order right D:
||it's like written on the site:
- if can explode then explode
else if can split then split - goto 1)||
Please spoiler this.
Thanks.
is that a spoiler really? clarification of requirements doesn't seem spoilery to me
ok but it's written on the site as well
that's why I'm asking here, not in the spoilers channel
Interpreting the problem description is part of the challenge.
I'd argue otherwise, but nvm
Might be my brain not in the mood for this today, but today's puzzle description seems really bad. Can't make sense of it and the examples don't illuminate at all
You are free to not consider it a spoiler if you wish, but other people might, so we are erring on the side of allowing the maximum number of people to enjoy the puzzle the way they want to.
but my partt 2 is wrong

the test for part 2 works though
No idea what I am supposed to do
Besides personally checking every single line added to eachother I don't really see what to do
and i think i'd rather cheese the solution than doing that
my problem was mutability
||You could try a bottom-up solution and construct your own test cases (for all subroutines), starting from the simplest possible ones and gradually adding more complex features. Eventually you might encounter a test case that fails. Something not covered by the ones in the problem description.||
my part1 changed the data used for part2. make sure that doesn't happen.
||Alternatively, you might spam a bunch of asserts all over your code and hope one of them breaks||
Yeah that sounds like a pain
Haaa
I mean I guess I know which lines produce magnitudes too large
I should probably add those together and see what should happen and what is happening
||There aren't really that many different possible configurations for the input to be in (that are categorically different, I mean), so you could just construct test cases for those and see if you get what you expect||
yesterday's puzzle makes me uncomfortable
I have no way of knowing whenever I truly have the best possible case or not
or do I
> vs >=

my add method was bonked
||basically if it added a 3 deep and a 4 deep together it thought the result is 4 long not 5, so it didn't reduce it||
ic
I hate day 17
||For which part?||
||I didn't find the O(1) solution myself either||
I don't even get the example
is it guaranteed that in any list there will never be a pair that is nested in more than 4 pairs?
oh
||you can check that for yourself||
ungh
I'm not sure how I am supposed to find the upper bound for the iterative method
is there even one?
||Yes, because an explode can only reduce the depth, and a split can only increase the depth by one, and after a split you will always perform any possible explode before you do another split||
||I just guessed the bounds and it worked||
lol I think he got tired of this challenge
well just woke up so hope today's isnt too hard
Depends
If you do it like me probably yes
If you do it normally probably fine
It's quite managable tbh but choosing how to do it might bring pain
:(
i did -200 to 200 and it was overkill but worked lol
uh oh is this another one like the fish where it's gonna be slow
||I did -1000 to 1000, lol||
lol
You can do it
for day17, ||I'm trying to get the x velocity towards 0
I was thinking about something like x_velocity -= towards_zero(x_velocity)
where towards_zero looks something like this
def towards_zero(nr: int) -> int: if nr < 0: return -1 elif nr == 0: return 0 else: return 1||
but I feel like there's something built-in for this already, and if not, that this at least has some sort of "official name" in comp science
anyone got an idea?
I don't think today's is super difficult, but it's a lot of work.
Please either spoiler this or discuss it in #advent-of-code-spoilers-archive .
Python 2 had a builtin called cmp() that did that. Now you can define it with: def cmp(a, b): return (a > b) - (a < b)
oh, my bad
it is the mathematical -sign function, so basically -abs(x) / x, I don't know if Python has an implementation for this
No worries.
oops, not what you asked 🙂
your definition of the sign function is not defined for x=0, theirs is

there's ||from numpy import sign|| 
:P
||x and -abs(x) / x||
||-copysign(1, x)|| should do the trick I believe but that's ugly
yeah, I also considered copysign, but that failed for 0 😅
also if would prob be more efficient anyway
it looks maybe large but i'd imagine the compiler is quite happy with it
ah, that's exactly what I was looking for... why'd they remove it from the stdlib?
oops throught i was over there
haha, fair
aahh, I didn't realize what the purpose of cmp actually was, that makes sense
so in trying to do the explode part ||i accidentally made the function handle every instance of explosion at once (which also works) when my original idea was to do them one at a time, at least that saved me a ton of time trying to set up a loop||
I'm not too sure that works
though, if it's ||only explosions||... huh.
yeah nevermind it doesnt lmao
but i fixed it
apparently i didnt
lmao, happened to me as well on day 12
woohoo, d17 is a great warmup to a day of intense programming
have fun with day 18 🙂
99 percent of the bugs on d17 were + 1, - 1, y1 vs y2 and < vs > lmao
For fishes they sure do have a complicated addition system
i sure will
are you starting day 18 today?
The only reason they haven't conquered the planet yet is because they have no need to. Their schoolchildren are as our adults, and their adults are as our Einsteins.
When the snailfish get bored with us, we won't stand a chance.
We're lucky they're far down in the ocean trench for now
I'm more worried for the lanternfish
imagine if they could come on land - they'd overwhelm us all
yep!
Hopefully the elves' packet transmission keeps them busy
sending useless messages
Today's?
I suspect they mean ||part 2 for today, having done part 1 already||
||i see nested, i smell recursion||
at this point i might as well do every single aoc problem with ||recursion|| lmao
Hey if anyone here has solved 2018 day 10 (https://adventofcode.com/2018/day/10), can you DM me your output? Looking for copies of the various letters, like these:
why is it that you need the output?
Didn't someone here make a advent of code letter reader thing?

Probably has all of them in it
Adding support for those taller letters to my library https://github.com/bsoyka/advent-of-code-ocr, they just have to be different from every other day lol
(Meee (probably))
fair enough, one sec
Sadly haven't done that
Every other day that has letters that I know of use 6-pixel-tall characters, but this one is just different 😂
||i see checking magnitude recursively, there is no doubt: i can taste the recursion||
Tastes lemony
I'll send my output on spoilers channel
As an update, if you have any letters not in this list can I have them lol ABCEFGHJKLNPRXZ
I have PANLPAPR
I think I have those ones already from the internet, will use yours to double check though thanks!
i just had a moment of realization
||day 18 is a binary tree, the nested levels are depths, dfs is used to traverse the tree and bfs is used to determine "first number to the left/right"||
oh wait
I'm finally finished!
WOOHOO!!!
recursion broke my brain. will reattempt the puzzle once my brain recharges
brain recharged. day 18, I'm coming for you
How'd you recharge? Was it all the energy from the glowing lanternfish
mostly a good supper, but the lanternfish helped
Question regarding Day 8 Part 2. I am struggling with it. My inner Alan Turing is running wild.
Will alphabetical sorting of segments input/output break logic of given puzzle?
||Alphabetical sorting will break the logic. Say with the example it gives you that deafcbg works, if you alphabetically sort it deafgbc would also work when it shouldn't because it's the same characaters||
Could you clarify a bit more?
Sure, so ||when you alphabetically sort, different types of combinations might be the same alphabetically but yield different results, because there's an order to the string.||
|| ddddddd
e a
e a
e a
fffffffffffff
c b
c b
c b
gggggggg makes deafcbg||
|| I see. Is this order derived from puzzle explanation or from solving it? I mean can you come to this conclusion without knowing the solution or not? ||
||This order is derived from the puzzle explanation||
slight progress, small victories
alright i have a party planned and i'm late so no more breaking my brain today
will attempt 3 tomorrow
Could you point me to that place in puzzle explanation. Because I read and re-read and even after your explanation, don't understand where it comes from.
Sure! One second
Thank you
they really ain't kidding when they said these two days were going to be hell
||The segment display above would form abcdefg, I actually just realized it wasn't explicitly mentioned but it was more an inference from how it was set up||
of participants who completed Part 2 of that day after every AOC day from the first day till now
thought you said no more breaking your brain 🙂
||
I looked on wikipedia seven-segment display reference and assumed the order is different, e.g. https://commons.wikimedia.org/wiki/File:7_Segment_Display_with_Labeled_Segments.svg#/media/File:7_Segment_Display_with_Labeled_Segments.svg
||
|| Do I assume correctly that either way I will need to trail and error different combinations for all segments to get correct one? ||
Basically what author says:
After some careful analysis, the mapping between signal wires and segments only make sense in the following configuration
You do assume correctly regarding that
Okay
if you have any more questions feel free to ask by the way (but just a side note: we won't have to put spoilers around everything if we move to #advent-of-code-spoilers-archive )
im so behind on aoc
stuck on day 10 : (
does it just keep getting harder after day 10?
in general problems get harder, but you might find something hard that others find easy and vice versa
don't stress over it - every puzzle you do means you learn something
would you like hints on this?
yea, thats true im gaining a lot from this just reading other ppl's code and stuff
that would be great!
OK - will post in spoilers channel. Part 1 or 2?
part 1
day18 is hard
what is not working?
thank god I'm done with this
ggs!
I'll be whipping up a call stack tmr, similar to how I did with d12
Hopefully that helps me
if I still can't solve it I might ask for a slight hint
gl
<@&518565788744024082> Good morning! Day 19 is ready to be attempted. View it online now at https://adventofcode.com/2021/day/19. Good luck!
oops
third
oop
Talk about a long problem
cool
god numpy wizards are gonna love this
I wish I knew numpy 😔 I'll learn it some day
heh, I stayed up so late today the new puzzle released. gotta sleep, bye
yep im not doing this today
well its been fun
say hi to the people at the top of the leaderboards for me
What's this?
Explain a bit
what language did you run it in? I had to wait a while for my python to run the second part (and had to run it twice due to typo)
so mine likes like 2-3 min to run
Python 3.10. Mine took 4 seconds
for part 2
I think your code is slightly more efficient
An earlier version had a lot more itertools.product until I realized I slightly misunderstood the problem (couldn't get scanner 2 to match in the example), and ended up getting rid of most of my product stuff
What's this? :(
Are you doing https://adventofcode.com ? You can see your personal leaderboard here: https://adventofcode.com/2021/leaderboard/self
I'm working on an encoder for day 18 (for debugging, not the solution). Can anyone help me convert my encode function from recursive to iterative? https://replit.com/@jmcantrell/RosybrownOtherConnection#main.py
What you can do is parse the input character by character
and push things onto a stack
so for [[1,2],[3,4]]
it'd go
I'm trying to go the other direction. Turning the tree back into a string.
look up inorder traversal
but there's really no point since when you recurse that's basically what it's doing anyway
I figured it would look something like that. I just can't figure out when to add the , and closing ]
, when going from left child to right, ] when you go up a level
def __repr__(self):
if self.value is not None:
return str(self.value)
return f'[{self.left}, {self.right}]'
that was my node class repr
that's essentially recursive postorder, right?
the , is inorder, ] is postorder
how so?, repr is getting called for the left and right child before the f-string is constructed
i've been sort of obsessed lately with coming up with iterative versions of recursive code. i find it irritating that i don't have better intuition about how to do this
Weekends are harder. The weekdays and the 25th are easier
O
man y'all too good giving me self confidence issues
time for day 15 :)
I've read half of today
And it reminds me so much of 2020 day 20
This will be pain
It is still in the middle of the day
The completion times also tell the story. It's some problem.
hi
my code works for todays test
but it takes like 13 seconds
to complete this test
did you face performance issues today ?
I just did day 16
new day, new attempt at day18
Good luck!
thank you!
Got some free time today morning if you want to bounce off some ideas lmk, I'm down
||my biggest problem rn is explosion and traversing the parents of my binary tree nodes lmao||
tysm, I'll be trying to write out some pseudocode first, if I get too stuck I'll ask for a hint :D
?
I'm like 99% sure that most languages do this
In [1]: -0
Out[1]: 0
is there any language which doesnt do this lol
JS belongs on esolang tbh
!otn a js is an esolang
:ok_hand: Added js-is-an-esolang to the names list.
:O
Lol
Yeah this day definitely giving me give up vibes my solution idea is kinda garbage
I guess I'll just do something else and try later
i dont understand a single thing this is saying
lots of random points on 3d plane that may be rotated randomly in any of the 24 possible ways to have a point rotated on a 3d plane
and you need to find points that are at the same place except the reference changes
Pure pain for me
I have an idea too it is just really bad or smth
Cause I am not getting closer to anything
Also at some point I noticed my code doesn't even correctly output all 24 rotatons
:(
for floats, there's a -0 and a +0
Okay lets go
I think I had an idea as well how it won't matter if -0 == 0
my initial idea was kinda stu pid
and I think I even managed to create all 24 permutations this time
nim> -0
how do u guys understand this coding stuff like me I don't know how to do all this stuff u guys do I wish I could code to XC
it's alright, we all start somewhere :) perhaps try doing some beginner projects first before you attempt aoc, the puzzles do get quite challenging
with some rigid body theory my Python solution runs in 60 ms (both parts, including tests)
wow
Now I'm curious what you mean by rigid body theory
r- rigid body theory-
Nice! What aspects of rigid body theory did you use? Is there something like a Wikipedia page that I can read, or something? 😛
[[[[0,7],4],[[7,8],[6,[6,7]]]],[1,1]] when the last 7 explode, does it actually have to increase the 1 on its right?
yeah
pain
my exploding / splitting works for some of the example inputs and times out for the rest of them 😔
are the remaining days actually going to be challenging or just painful like that
because honestly I'm not having fun on those last few puzzles haha
like the pathfinding one was really fun
here it is just adding a bunch of corner cases just to spite you
just thinking of the 12 (or more) overlapping beacons as a rigid body where all the points are connected by rods. Then provided rods are unique within each scanner you can use those to simplify things a bit 🙂
Don't think I understand 19....how can you tell if beacon readings from scanners overlap when coordinates are relative? Couldn't all the scanners be super far away from each other and have no overlap?
vbBuSOtTSQU08h/oMt6GJsXJD5pcuveUr/MD3VnEVq4St1WK7nqUMgKP7skkqi/JwUldcB+pwTzAzPyHNAO5PcLugBd/MjPX0pv77EJOvAdjV+e1QZh6iSstO637NW/vKK9/wudHTHvB/jSxV/yO6h7aK1I+oZiMSqbb9BiWpJ4=
can someone decode this
it guarantees you that if two scanners see a cluster of 12 beacons at the same relative positions, they're the same 12 beacons
??
Hmmm....so the same positions relative to each beacon? Or the same literal position values
positions of the 12 beacons relative to each other
like in the 2d example, the 3 beacons form the same triangle
Hmmm ohhh
moral of the story: ||when recursion breaks brain, use iteration instead||
5.5 hours
that took some time lmao
||i used brute force and permutations on part 2 so it's quite inefficient, don't know if there's a clever way||
Hey don't worry still better than me
I am still not really anywhere close to a solution
:)
It appears random rotations are my enemy
I just lose interest
damn, day 18 really was tough for me
it was rough
especially for people who stuck with the recursive approach it seems
trees kind of stop being elegant and easy to work with once you start needing backreferences
It wasn't too bad, just needed to keep the path down the tree
cough me cough
Stuck at day 12
The more I wanna commit, the less i get stuff done
Gonna be in as many dead ends as the cave's paths
where can i see the puzzles of AoC?
Well, I guess you either keep the path or you use back references
Most people used back references it seems
You don't need both
||you dont want to see what i did lmao||
Sometimes I truly do hate node js
Error in your code?
Process exited with code 1

fk you too ig
How to debug in node.js: just paste it into firefox instead it'll tell you whats wrong

is there any way i could implement if/else logic without actually using it?(may be design pattern)
How did you like the approaches you got suggested?
also, this is #advent-of-code, not #python-discussion
day 19 part 1 complete!
god this took forever to do
Yeah I'm still not done
I got close tho
The test almost worked once but it had no reason to
Oh well maybe part 2 is eaasy then
except my part 1 now takes about 1 minute to find scanner 1 being close to scanner 0
This is so bad
And it can't even find 4 for some reason

might need optimizing
||i know mine does||
oh
my code is super broken somehow
It like kinda got something but the coordinates of scanners were wrong
nicee!!
so I changed it so it klnows where the sacnners are except now all the other stuff seems broken

do you want to see the spaghetti used to solve it lmao
Idk how this works
How are either my beacon coordinates in the example right
or my scanner coordinates
what is going on
That makes no sense
sure
let's post in #advent-of-code-spoilers-archive
just so we don't need to spoilers everything
Completed Day 19!
Nicee!
||you didn't use recursion ?! You must be an imposter||
It finally finds all the scanners at the right places but it finds way too few beacons

lmao i still used ||recursion for other parts of the tree, just not the parent traversal for explosion part||
79
O:::
pls work on actual inputtt
thanaksksss
If this doesn't work my spirit will be broken
Especially since I'm estimateing this has to run for like half an hour to get anything
this is so bad
||ditto - I used recursion to make the entire thing flat before doing anything else||
rip
How long does your part 1 run
print intermediate results so you can see progress - I print ||every pair being considered||, that kind of thing
I mean I have one idea how to optimize it actually
I print ||scanner coordinates and the queue||
my day19 takes like 30-60s? part2 is instant-ish once you do part1
||I'm at 0.5 secs for part 1||
from what I've seen, there're three factions: ||the tree purists, the tree flatteners, and the we-dont-talk-about-them cough trig solving it with strings cough||
I mena my code is just so bad but it should work theoretically
||trees|| are poggers
Please work for the love of god
|| The best solution is flat, just like the earth||
I'll start trying to implement some optimization cause this is gonna take awhile
||the earth is not flat smh||
It's a doughnut
||if only it was a tree||
oh shit- the earth is flat????? I thought it was a slice of pizza this whole time
A doughnut is extremely accurate if you think about it
Red filling, ball shaped, stuff on top
Depends on the donut
I think the topology is wrong for that lol
I was thinking ring donuts and was confused lol
Only if you think about the wrong donut
what's the right one
Lol, in the olden days a donut was actually the ball
oh
hmm
If you reheat a jam doughnut in a microwave, the jam inside is as hot as the centre of the earth
Sounds about right
petition: rename your stereotypical ring-shaped donuts to toruses
that's what they're supposed to be called smh
ouch
Yea
My code is made really badly and I know it
THE DOPAMINE
aaaaaaaaaaaaaaaaaaa
NO I HAVE TO RUN IT AGAIN
FK
I'm so happy
wait nvm I don't I got that already
ok I think I'm getting the grip at day 12 (FINALLY)
This is my first AoC, and I've done alright I think for 2021, skipped or got stuck on 2 or 3 puzzles using C#, my first language with 20 years strong experience. Now I hope to complete the 2019 AoC in Python, my second favourite language with 2 years self-teaching
is there a competition like AOC that runs for an entire year? Only 1/2 questions each day with varying difficulty?
That would be fun to do!
YESSSS
its doooooooone
i somehow did ||manhatten|| wrong
im so good at thisss
aaaaaaaaaaaaaaaa
That took like
10 hours since I first saw the problem
Though to be fair I did not programm 10 hours long
I did take breaks
It's not even that bad
leetcode?
that is still quite employment oriented.
Basically puzzles like AOC or Project Euler with a constant leaderboard (which is optimization oriented instead of speed of solution) that have new problems everyday 
which is optimization oriented instead of speed of solution
that'd be codingame's optimization or bot programming puzzles, which I love
but they are far from one per day lol
but what if there's an entire team behind it?
I guess this is a good idea for a DAO.
somewhere I read it takes 6 months or something
Eric Wastl said that it takes him 4-5 months to come up with all these, yeah
The puzzles are most of the work; preparing a new calendar and a new set of
puzzles each year takes all of my free time for 4-5 months. A lot of effort
went into building this thing - I hope you're enjoying playing it as much as I
enjoyed making it for you!
view-source:https://adventofcode.com/
are there bot programming puzzles?
i wanted to build one
So I've been self teaching myself python - I am about 1 month into my journey so far, and half way through the online bootcamp I've been following. Decided to take a break, and start on advent of code to see if I could do these challenges.
I've cleared day 1-3 so far. I'd be curious to know if anyone here would be willing to have a look at my solutions and offer feedback on whether my approaches are considered good, bad, over simple, over complex, or what.
Being that I am self teaching - I've got no one to give me feedback on my code really.
Feel free to share your code, just remember to put it in spoilers since some people haven't completed thoes days yet
those*
I was going to just link to my github.
My day 1 and 2 solutions are on here - so of course - spoiler warning
I just solved day 3, but I am cleaning up the code a bit before I commit it.
Changed me nick - forgot to update it in discord.
@pallid quail without going too deeply into it, your code looks pretty clean so that's a plus
Thanks - glad to hear that. Been putting effort into that - not sure if I am following all of the proper python style conventions though.
If you are ever unsure, there's a handy song for that :)
A songification of that most holiest of Python Enhancement Proposals, the PEP 8.
Based on an idea by Daniel "Mr. Hemlock" Brown.
Written and performed by Leon Sandøy, A.K.A. lemonsaurus.
Music and melody from Mad World by Roland Orzabal. This version was inspired by the version released by Gary Jules.
🌎 Website: https://pythondiscord.com/
💬 ...
haha nice
I'm especially proud of day 2, where I wrote my first recursive function - did that again on the day 3 solutions.
This year is partly Advent of Recursion
I've written a lot more recursive solutions than I've done before
yeah, as I was noodling that, I sort of accidentally stumbled into recursion - the online course I've been doing hadn't even introduced that yet.
I just sort of wondered - can a function call itself, googled it and thats how I learned recursion.
Ah nice!
AOC is pretty good for that
It's not too common to write recursive solutions in Python
Most of the time you use loops/iteration
AOC is good for utilising idioms like that more often
Honestly, I've learned a TON just in the last 3 days.
That, and I've also I think just by the extra practice have further strengthened the new python neural pathways in my brain.
Things come a bit easier now, instead of having to sit and try to remember syntax and stuff.
I can focus on just writing code to try and solve whatever it is I am working on.
Nice!
I just have my editor setup to format with black on save, and mostly stopped worrying about formatting other than that
I've no idea what that means.
black is an automatic python code formatter. See https://black.rtfd.io and #black-formatter.
neat - I'll have to look into that.
I think i've used recursion just twice so far
Right, I've learned a lot about recursion with AOC
I've posted my day 3 solution
I think its my best code so far!
lmao didn't know readthedocs.io had rtfd
oMg hOW DarE yOu SAy rTfd ThAt'S TOxIC!!!111
wait mods get pinged when regex detects r t f m as a single word right
read the fucking documentation, yeah i think that's what it means
debatable
i've learned it as Refer to the following documentation
oh?
hm, debatable indeed
i'm not sure then
and that's why people send a link along with "rtfm" or "rtfd"
pretty sure rtfm is not refer to the following manual
lol
contextual i guess
if i'm not being passive aggressive i think it's fine
literally 1984
uh oh sorry mods for the ping lmao
we did not get pinged :)
what. kat, you lied to me
i'm pretty sure kat said there was a filter for rtfm
there may have been at one point
yep, DATA got filtered
now that one did ping, thanks
oops sorry!
all good haha
i may have gotten the two mixed up - DATA is the one being filtered and pinged
rtfm in a link won't ping iirc, I don't remember if regular rtfm pings
rtfm
does it ping
it does not, although I should probably suggest that
Sometimes rtfm is referred to in actual docs, so I think we did have it at one point but it was too noisy
what is the regex for DATA? the whole thing or just d ontasktoask.com (added space so no potential ping)
ah, okay
.src filtering
It's in Python, let me pull the filter for you
Although it's added via command so, but iirc we added it as a domain filter
If only that website was written in a nicer way
The meaning really isn't that wrong in many cases
It's worded so mean though
yeah it's genuinely useful advice in a vacuum
So the website content itself is honestly fine, we don't filter it because of the website itself
Rather, it's how others here were using it
I think the website is written fine, it's the dismissive manner in which it is dropped that becomes a problem
does XY problem get flagged
!xy
xy-problem
The XY problem can be summarised as asking about your attempted solution, rather than your actual problem.
Often programmers will get distracted with a potential solution they've come up with, and will try asking for help getting it to work. However, it's possible this solution either wouldn't work as they expect, or there's a much better solution instead.
For more information and examples, see http://xyproblem.info/
I hope not =P
But someone new to the server would ask "hey, can anyone help me with something" because that's the polite thing to do in non-internet spaces. Someone would just drop the don't ask to ask link and say nothing else, making it a very bad experience
yeah pretty sure it's stated to not do that in the coc
doing AOC has helped me garner a lot of useful tricks and modules in my Python armoury
especially collections
and re
pythonifying my severely grep'd regex has been my fear until now
Yeah, I really like the fact that everyone is mostly on the same day, makes discussion for that day much more productive
ah yes, i do agree with that. i haven't considered this case until now, where it's common sense to ask to ask irl
so someone who's just starting to be on the internet could have a bad experience
AOC has teached me a lot too
like the fact i am really bad with arbitrarily rotated data
and I guess also some positive things
Recursive regex is pretty cool was quite happy to use that
lol, aoc taught everyone they can't read http://adventofrealizingicantread.com
r- recursive regex??????
Yea
ooo interesting
||Used it for day 18 to parse the snailnumber||
I used recursive regex in ||2020||
||It basically either matches a number on each side of the , or itself which is another snailnumber, so it works quite well to capture the outer part||
||... i just literal_eval'd||
||same, ast.literal_eval for me||
lmao
b- bUt iT's LitErALeVal!!!111
||json.loads anyone?||
that is actually so smart
i should learn recursive regex
functions exist so that we can use them 
It's cool but I also just noticed that loading it as ||JSON or literal_eval|| is like 100% easier
Still like it though
||yeah json has lists||
agreed, don't reinvent the wheel
okay ima go do d15 now to get my missing stars
bye
yessir
it's time to.. refactor my horrific solution for today
okay there is no way im brute forcing d15
||but i don't know how to implement a* 😔||
time to learn it
||Check outheapq module||
<@&831776746206265384>
!shhh
✅ silenced current channel for 6 minute(s).
!unshh
✅ unsilenced current channel.
that was scary
anyway
||for me doing day 15 it was all about heapq||
i really want an AOC day where i can load stuff to the GPU
today might be a good candidate?





