#advent-of-code

1 messages · Page 49 of 1

noble skiff
#

there's a pretty clear difference between today's problem, which many people have commented on how long it took to simply read

#

vs e.g. the folding question, which was much quicker to read, and still led to needing an insightful solution (for the second part)

sleek cave
#

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

quaint hare
#

.aoc unsubscribe

hidden copperBOT
#

Okay! You have been unsubscribed from notifications about new Advent of Code tasks.

rough siren
#

.aoc lb

hidden copperBOT
#

:x: Please use #aoc-bot-commands for aoc commands instead.

honest nacelle
#

FINALLY finished day 15, that one really kicked by butt

woven oriole
#

.aoc c

hidden copperBOT
#

Day 17 starts <t:1639717200:R>.

humble copper
#

30 seconds

woven oriole
#

gl

humble copper
#

good luck everyone

#

and godspeed

hidden copperBOT
sinful pawn
#

oops

foggy zealot
#

second

uneven hollow
#

gl

humble copper
#

i have no idea how to begin

uneven hollow
#

physics

velvet stag
#

heck ya

#

this is the advent i know

#

this is 2019

#

this is the day i skip

tulip harbor
#

it's your ||cartesian ||whatnots

sonic silo
#

this is cute

iron reef
#

I've just finished reading this and I feel like this can just be solved on paper

woven oriole
#

exactly

#

vector analysis

#

but can anyone just confirm the drag

hazy pendant
#

woven oriole
#

changes by 1 toward the value 0

#

what value

hazy pendant
#

this is a very ∑ moment

still tangle
#

what the converstion

#

wath's the convesation

#

hello

humble copper
#

yknow what this was fun but im gonna put this as a "do after a night of sleep" thing

tulip elbow
#

I really wish I knew how to read

hazy pendant
#

lmao

#

that one computer when solving aoc:

maiden brook
#

looks more like cobra

ember cargo
#

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

tight dune
dense ibex
#

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

blazing kraken
#

Again I make my opinion of "python is slow of aoc"

tight dune
#

for aoc python is fast enough

#

it depends on ur algorithm

eternal shale
#

Help with this code

dense ibex
unborn trout
#

Python 2 ??

tight dune
#

and what is that os

proud cosmos
#

Wondering why I can't just go 6,9e9e9e9e9e9e9 for the example in part 1

muted aurora
proud cosmos
#

y not

#

it'd fly straight down over the target area

muted aurora
#

it's not continuous time

proud cosmos
#

see the graph for 6,3

#

so why can't I just set the height to the integer limit

zenith mulch
muted aurora
#

yeah but it can skip over the entire box in 1 unit of tim

#

if the velocity is too high

proud cosmos
#

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

muted aurora
#

this example:

x = 0
y = 0
vy = -100
target area is from (-1,-1) -> (1,-2)
proud cosmos
#

Figuring out 6,9 is max though sounds kinda difficult

#

oh well

muted aurora
#

you'd just straight from y=0 to y=-100 and never be in the box

lilac ivy
#

.aoc subscribe

hidden copperBOT
#

Okay! You have been subscribed to notifications about new Advent of Code tasks. You can run .adventofcode unsubscribe to disable them again for you.

lilac ivy
#

.aoc join

surreal sky
#

.aoc unsubscribe

hidden copperBOT
#

Okay! You have been unsubscribed from notifications about new Advent of Code tasks.

surreal sky
#

.aoc subscribe

hidden copperBOT
#

Okay! You have been subscribed to notifications about new Advent of Code tasks. You can run .adventofcode unsubscribe to disable them again for you.

sleek cave
#

currently i have no approach other than brute force, which I assume is too inefficient for the input size

#

the puzzles are getting spicy

crystal shard
sleek cave
#

Oh

glad tartan
#

oh sorry i thought I was there! 😦

#

my bad lol

sleek cave
dusk cove
devout tusk
crystal shard
humble copper
#

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?

muted aurora
#

but even with brute forcing ||you can be smart about which values you check by doing some math||

humble copper
low condor
#

Day 17 done!

#

I liked part 1 in particular

crimson marten
#

I did days 1 and 2.

#

Now I need to finish the rest and catch up!

#

I feel so behind haha.

low condor
#

good luck! And don't worry about it, the most important thing is learning along the way

crimson marten
#

Haha for sure.

#

It's just good fun at the end of the day.

humble copper
#

this feels cheap

#

i didnt do this right wtf

low condor
#

let me guess ||you used brute force 💪 ||

humble copper
low condor
#

I did so and fully expected it to

crimson marten
#

Haha.

#

Now to re-do 😉

#

Ohh wrong chat.

jade atlas
#

.aoc unsubscribe

hidden copperBOT
#

Okay! You have been unsubscribed from notifications about new Advent of Code tasks.

noble skiff
#

i kind of feel like today's puzzle can be done mostly with pencil and paper... maybe I'm wrong though

low condor
#

||part 1 definitely can||

noble skiff
#

actually yeah that prob doesn't work

fossil cipher
noble skiff
#

i actually just did part 1 in my head lol... no pencil or paper

#

first time I've ever seen an AoC like that

low condor
#

I needed paper to twig the concept

sonic silo
#

||for bruteforcing it just took me 30 secs per run lol||

sonic silo
#

ye

#

||mind you, per run PER part||

#

||3:30 mins, 3 mins to add the change and run it twice||

low condor
#

||For Day 17 that is super slow to take 30 secs||

woven oriole
#

nice dedication

#

towards cpu

#

:D

sonic silo
woven oriole
#

||all you can do is minimize the randomized bruteforce range||

#

||to some mere two digit number iirc someone did that in subreddit||

sonic silo
#

||i know||

woven oriole
#

||hm||

sonic silo
#

||there's closed solutions to this||

#

||'nother thing is whether i wanna bother lol||

woven oriole
#

||lol||

low condor
#

this is quickly become Advent of REDACTED again 🙂
||I would say it's worth knowing how to do part 1 properly||

woven oriole
#

||yes||

#

||definitely||

low condor
#

||Part 2 on the other hand - yeah, I did a brute force just with minimum ranges of x and y calculated beforehand||

woven oriole
#

||\👌||

humble escarp
sinful pawn
#

are we speaking morse code in here or what lol

wooden jewel
#

||-. --- / .-- . .----. .-. . / -. --- -||

strange zinc
#

Any helpful advice for day 16? Mind is pretty boggled at this moment

low condor
strange zinc
#

Thanks

humble escarp
#

Done for today 🤘

wooden jewel
#

nice

mossy basin
hidden musk
#

:O

devout tusk
woven sable
#

Woah

placid lake
#

niiice

hollow wharf
#

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

sleek cave
#

okay, gonna clean up yesterday's solution and then it'll be time for day 17

#

wonder what awaits me today

mossy basin
#

i wonder how many days i can string together to make a submarine game

#

gonna bonk lantern fish with drones

sleek cave
mossy basin
#

that would probably be too crowded on a terminal, but this has been a great way to debug my library

sleek cave
#

||okay perhaps i could use quadratic functions to solve d17? (or maybe just brute force lmao)||

woven sable
bright haven
woven oriole
#

||call it grid search not brute force 😎 ||

velvet stag
#

seben

woven oriole
#

sex

#

.aoc c

hidden copperBOT
#

Day 18 starts <t:1639803600:R>.

woven oriole
#

not once again advent of algorithms taught in uni

#

🥴

woven sable
#

I wonder if the ||pathfinding|| day was just a fake peak, and this weekend will be the real challenge

velvet stag
#

i bet it was real peak

hidden musk
#

this weekend is traditionally the hardest 👀

prisma sundial
#

gl

woven oriole
#

what about sunday smh

hidden copperBOT
sinful pawn
#

oops

signal grotto
#

Woo weird math

velvet stag
#

i did thing lyk this once took me maybe 6 hours

humble copper
#

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

devout tusk
#

too much artificial difficulty on this one. I can't be asked to parse this shit rn

humble copper
#

if it's late and the problem is too difficult i just start it the morning after

woven sable
#

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

stable heron
#

i dont feel like doing it rn

humble copper
#

ouch

weak torrent
#

me not understanding anything in this question 😔

muted aurora
#

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]]]]
velvet stag
#

i think it can be anything

#

a bug in split

#

a bug somewhere

pallid quail
#

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?

uneven hollow
pallid quail
#

I forgot to mention, I was going to pop the first index position out each run

uneven hollow
#

yeah then u dont really need the length of the list

#

just recursive call it with the new list

pallid quail
#

How do I get it to stop when there are less than 3 items left in the list

#

Oh wait

#

nm

uneven hollow
#

if len(list) == 3:

dont pop

pallid quail
#

Yeah

#

just thought of that

uneven hollow
#

👍

pallid quail
#

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.

uneven hollow
#

good idea

pallid quail
#

Holy crap, it worked.

#

My first recursive function 🙂

hollow wharf
broken pasture
#

hey guys

#

i am doing advent of code Day 16 Part 1 currently

regal gazelle
#

I always have problems with .exe

broken pasture
#

and currently my code correctly parses all the examples and gives the right answer but gives the wrong answer on my real input

velvet stag
#

make sure you;re not storing 6 as "110" for example

#

i guess that would show up in examples

broken pasture
#

yeah

velvet stag
#

there's not really a big difference

#

in the real input

broken pasture
#

i will paste my code here

velvet stag
#

ok

#

no wait

#

that's a spoiler

broken pasture
#

should i dm you the code then

velvet stag
#

sure go ahead

broken pasture
#

hey guys can anyone help me with advent of code day 16 part 1

rancid creek
rancid creek
broken pasture
#

nevermind figured it out @rancid creek

muted aurora
restive imp
#

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?
abstract bluff
restive imp
strange zinc
#

We have another essay today 😆

abstract bluff
#

yes

proud cosmos
#

me: why is this recursing infinintely what

#

also me: giving it itself as argument

hollow wharf
#

so for yesterday

#

it seems like there is ||a quite simple mathematical|| solution

#

is that worth exploring for part two lol

maiden brook
#

worth I'd say, it can get quite efficient

bright spindle
#

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

maiden brook
sleek cave
#

evil puzzle

#

why nested data structs

woven oriole
#

||parse string > making tree hehehe||

proud cosmos
#

Honestly might've been easier

sleek cave
#

okay, my to-do list for today:
d17 appetizer
d18 main course (one of the hardest problems of the entire aoc)
d15 dessert

proud cosmos
#

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

sleek cave
hollow wharf
#

is there like a leaderboard for AoC, so i see which implementation is the fastest?

proud cosmos
#

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

maiden brook
#

tag @muted aurora since I asked about this a few days ago

hollow wharf
#

meh

#

idc about bigger inputs

#

i was curious about optimized solutions

#

performance

maiden brook
#

well, to process bigger inputs in a reasonable amount of time you need faster solutions

hollow wharf
#

doesn't matter

#

you can still do them with slow implementation

#

and with python 😂

bright spindle
hollow wharf
#

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

bright spindle
#

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.

hollow wharf
#

150ms is huge

woven solar
#

huh, that's really fast, is that in Python?

bright spindle
woven solar
#

ah, that explains it

hollow wharf
bright spindle
#

And like I said, this is my naive solution.

#

The point is that it's easier to distinguish performance improvements with longer runtimes.

hollow wharf
#

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

bright spindle
rapid wolf
#

an example is the lanternfish day, where the matrix solution was slower for 80/256 days, but for 1mm+ days it was vastly faster

bright spindle
#

Well, fair enough.

hollow wharf
bright spindle
#

Still fun, though.

hollow wharf
#

(C char, otherwise uint8)

hollow wharf
#

day 11

bright spindle
#

I see what you're saying

hollow wharf
#

so no need to bring in list into the story

#

and keep allocating

#

(which'd be dynamic)

low condor
#

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

bright spindle
#

||Then after you've done a split, you again try as many explodes as possible before trying another split||

low condor
#

right - that's what I thought - yet for some reason can't get the order right D:

dark slate
#

||it's like written on the site:

  1. if can explode then explode
    else if can split then split
  2. goto 1)||
bright spindle
#

Thanks.

low condor
#

is that a spoiler really? clarification of requirements doesn't seem spoilery to me

dark slate
#

ok but it's written on the site as well

low condor
#

that's why I'm asking here, not in the spoilers channel

bright spindle
low condor
#

I'd argue otherwise, but nvm

fossil cipher
#

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

proud cosmos
#

I think I am stuck completely

#

every single test works

#

part 1 works

bright spindle
# low condor I'd argue otherwise, but nvm

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.

proud cosmos
#

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

woven solar
bright spindle
# proud cosmos No idea what I am supposed to do

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

woven solar
#

my part1 changed the data used for part2. make sure that doesn't happen.

proud cosmos
#

I forgot aoc is not that dumb and I can't get any more info

#

lol

bright spindle
#

||Alternatively, you might spam a bunch of asserts all over your code and hope one of them breaks||

proud cosmos
#

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

bright spindle
#

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

hollow wharf
#

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

proud cosmos
#

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

bright spindle
#

ic

hollow wharf
#

I hate day 17

hollow wharf
#

part 1

#

I think I have an idea actually

bright spindle
hollow wharf
#

I don't even get the example

humble copper
#

is it guaranteed that in any list there will never be a pair that is nested in more than 4 pairs?

hollow wharf
#

oh

maiden brook
hollow wharf
#

ungh

#

I'm not sure how I am supposed to find the upper bound for the iterative method

#

is there even one?

proud cosmos
#

yes

#

pretty simple one i think

bright spindle
bright spindle
mossy stream
#

lol I think he got tired of this challenge

pallid stirrup
#

well just woke up so hope today's isnt too hard

proud cosmos
#

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

#

:(

pallid stirrup
proud cosmos
#

Also 20 pages

pallid stirrup
#

uh oh is this another one like the fish where it's gonna be slow

bright spindle
pallid stirrup
#

lol

proud cosmos
#

You can do it

finite cove
#

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?

bright spindle
#

I don't think today's is super difficult, but it's a lot of work.

bright haven
finite cove
#

oh, my bad

mossy stream
bright spindle
#

No worries.

bright haven
proud cosmos
maiden brook
proud cosmos
#

There does exist math.copysign though

#

Which is not equivalent but exists

mossy stream
#

||x and -abs(x) / x||

#

||-copysign(1, x)|| should do the trick I believe but that's ugly

proud cosmos
finite cove
#

yeah, I also considered copysign, but that failed for 0 😅

mossy stream
#

uuhh

#

oh, and

proud cosmos
#

also if would prob be more efficient anyway

#

it looks maybe large but i'd imagine the compiler is quite happy with it

finite cove
mossy stream
#

because now we have fancier comparison dunders

pallid stirrup
#

oops throught i was over there

mossy stream
#

haha, fair

finite cove
humble copper
#

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

woven solar
#

I'm not too sure that works
though, if it's ||only explosions||... huh.

humble copper
#

but i fixed it

humble copper
sleek cave
sleek cave
#

woohoo, d17 is a great warmup to a day of intense programming

low condor
#

have fun with day 18 🙂

sleek cave
#

99 percent of the bugs on d17 were + 1, - 1, y1 vs y2 and < vs > lmao

woven sable
sleek cave
low condor
woven solar
woven sable
#

We're lucky they're far down in the ocean trench for now

low condor
#

I'm more worried for the lanternfish

#

imagine if they could come on land - they'd overwhelm us all

sleek cave
woven sable
#

sending useless messages

humble copper
#

achievement on its own for me

#

wow that was easy ok

hollow wharf
#

Today's?

low condor
#

I suspect they mean ||part 2 for today, having done part 1 already||

sleek cave
#

||i see nested, i smell recursion||

#

at this point i might as well do every single aoc problem with ||recursion|| lmao

signal grotto
low condor
proud cosmos
#

Didn't someone here make a advent of code letter reader thing?

#

Probably has all of them in it

signal grotto
proud cosmos
#

Forgot who it was

#

Oh that was you

#

I see

signal grotto
proud cosmos
#

Sadly haven't done that

signal grotto
#

Every other day that has letters that I know of use 6-pixel-tall characters, but this one is just different 😂

sleek cave
#

||i see checking magnitude recursively, there is no doubt: i can taste the recursion||

proud cosmos
#

Tastes lemony

low condor
signal grotto
#

As an update, if you have any letters not in this list can I have them lol ABCEFGHJKLNPRXZ

signal grotto
#

I think I have those ones already from the internet, will use yours to double check though thanks!

sleek cave
#

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

woven sable
#

I'm finally finished!

sleek cave
sleek cave
#

recursion broke my brain. will reattempt the puzzle once my brain recharges

woven sable
#

Pretty massive drop today

#

even though the day isn't over, there's a notable drop

sleek cave
#

brain recharged. day 18, I'm coming for you

woven sable
sleek cave
#

mostly a good supper, but the lanternfish helped

humble copper
#

you got this

fervent talon
#

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?

woven sable
fervent talon
#

Could you clarify a bit more?

woven sable
# fervent talon 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||

fervent talon
#

|| 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? ||

woven sable
sleek cave
#

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

fervent talon
fervent talon
#

Thank you

sleek cave
#

they really ain't kidding when they said these two days were going to be hell

woven sable
# fervent talon Thank you

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

low condor
fervent talon
#

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

woven sable
fervent talon
#

Okay

woven sable
#

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 )

fervent talon
#

Okay. Got it. Good point.

#

Have to sleep on it. Will probably ask more tomorrow 🙂

violet raft
#

im so behind on aoc

#

stuck on day 10 : (

#

does it just keep getting harder after day 10?

low condor
low condor
low condor
violet raft
#

yea, thats true im gaining a lot from this just reading other ppl's code and stuff

violet raft
low condor
violet raft
#

part 1

sacred geyser
#

day18 is hardjoe_3d

sleek cave
#

day 18 is so tough

#

i can't get the explosion working 😔

#

tomorrow, attempt 4

abstract bluff
noble skiff
#

thank god I'm done with this

sleek cave
#

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

prisma sundial
#

gl

hidden copperBOT
hazy pendant
#

i give up

#

anyways

sinful pawn
#

oops

foggy zealot
#

third

sonic silo
#

oop

woven sable
#

Talk about a long problem

lost dock
#

cool

pearl needle
#

god numpy wizards are gonna love this

woven sable
#

I wish I knew numpy 😔 I'll learn it some day

sleek cave
humble copper
#

yep im not doing this today

#

well its been fun

#

say hi to the people at the top of the leaderboards for me

lapis jay
modern harness
# lapis jay

Nice job making it onto the global leaderboard on part 2!

modern harness
lapis jay
#

so mine likes like 2-3 min to run

modern harness
#

for part 2

lapis jay
modern harness
pallid shoal
pallid shoal
modern harness
dense herald
flat sequoia
#

and push things onto a stack

#

so for [[1,2],[3,4]]

#

it'd go

dense herald
flat sequoia
#

ooh

#

sorry i misread

#

you can do the same thing though pushing things onto a stack

lapis jay
#

look up inorder traversal

flat sequoia
#

but there's really no point since when you recurse that's basically what it's doing anyway

dense herald
#

I figured it would look something like that. I just can't figure out when to add the , and closing ]

lapis jay
#
    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

dense herald
lapis jay
#

the , is inorder, ] is postorder

dense herald
#

how so?, repr is getting called for the left and right child before the f-string is constructed

lapis jay
#

ah, yeah I suppose so

#

I was thinkin literally about the charectors

dense herald
#

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

gloomy kernel
#

Yye

#

I won't continue aoc

modern harness
gloomy kernel
#

O

devout tusk
#

What is the question even trying to say? I don't think I understand it

#

....

void ocean
#

need to catch up soon

#

haven't done aoc in a week

muted aurora
digital ember
#

time for day 15 :)

proud cosmos
#

I've read half of today

#

And it reminds me so much of 2020 day 20

#

This will be pain

twin fog
#

I think this says it all

proud cosmos
#

It is still in the middle of the day

twin fog
#

The completion times also tell the story. It's some problem.

proud cosmos
#

It's hard for sure yea

#

Still haven't even done part 1 Lol

stable heron
#

i havent done like

#

a lot of

#

challenges

#

😭

primal vapor
#

hi

#

my code works for todays test

#

but it takes like 13 seconds

#

to complete this test

#

did you face performance issues today ?

steel bear
#

🥲

stable heron
#

🥲

frigid zephyr
#

I just did day 16

sleek cave
#

new day, new attempt at day18

muted aurora
sleek cave
muted aurora
#

Got some free time today morning if you want to bounce off some ideas lmk, I'm down

sleek cave
#

||my biggest problem rn is explosion and traversing the parents of my binary tree nodes lmao||

sleek cave
proud cosmos
#

JS is litearlly juist ignoring my -0 and turning it into a normal 0

#

:(

#

y

peak dock
#

?

sinful pawn
proud cosmos
#

Fair

#

and my solution kinda needs it but not always

#

It's a mess for sure

sinful pawn
#
In [1]: -0
Out[1]: 0
proud cosmos
#

I mean the funny thing is it kinda keeps it but not really

sinful pawn
#

oh. gross

#
nim> -0
0 == type int
peak dock
sinful pawn
#

Apparently JS to some extent

#

which is weird but... then again, it's JS

peak dock
#

yeah

#

js doesnt count

sinful pawn
#

JS belongs on esolang tbh

peak dock
#

!otn a js is an esolang

marsh currentBOT
#

:ok_hand: Added js-is-an-esolang to the names list.

sinful pawn
#

:O

proud cosmos
#

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

humble copper
#

i dont understand a single thing this is saying

proud cosmos
#

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

twin fog
#

I can see how you'd do it

#

Like, || make a list of edge||

proud cosmos
#

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

#

:(

hidden musk
#

for floats, there's a -0 and a +0

proud cosmos
#

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

olive glen
#

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

sleek cave
glad tartan
#

with some rigid body theory my Python solution runs in 60 ms (both parts, including tests)

wooden jewel
#

wow

noble skiff
#

Now I'm curious what you mean by rigid body theory

sleek cave
#

r- rigid body theory-

drifting saddle
mossy stream
#

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

mossy stream
#

pain

pliant comet
#

my exploding / splitting works for some of the example inputs and times out for the rest of them 😔

mossy stream
#

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

glad tartan
pearl moon
#

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?

jolly comet
#

vbBuSOtTSQU08h/oMt6GJsXJD5pcuveUr/MD3VnEVq4St1WK7nqUMgKP7skkqi/JwUldcB+pwTzAzPyHNAO5PcLugBd/MjPX0pv77EJOvAdjV+e1QZh6iSstO637NW/vKK9/wudHTHvB/jSxV/yO6h7aK1I+oZiMSqbb9BiWpJ4=

#

can someone decode this

peak dock
jolly comet
#

dk what it is

#

i need it for the riddle

#

xd

proud cosmos
#

base64

#

Most likely

pearl moon
peak dock
#

positions of the 12 beacons relative to each other

#

like in the 2d example, the 3 beacons form the same triangle

pearl moon
#

Hmmm ohhh

sleek cave
#

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

proud cosmos
#

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

pearl moon
proud cosmos
#

Just please let me solve this today

#

it's just not working

sleek cave
#

damn, day 18 really was tough for me

noble skiff
#

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

proud cosmos
#

Okay I almost kinda have it find the first 12

#

That's something

#

Woo.

glad tartan
robust heart
#

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

prisma valley
#

where can i see the puzzles of AoC?

woven solar
noble skiff
#

Most people used back references it seems

#

You don't need both

humble copper
proud cosmos
#

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

snow cargo
#

is there any way i could implement if/else logic without actually using it?(may be design pattern)

woven solar
humble copper
#

day 19 part 1 complete!

god this took forever to do

proud cosmos
#

Yeah I'm still not done

#

I got close tho

#

The test almost worked once but it had no reason to

humble copper
proud cosmos
#

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

humble copper
#

||i know mine does||

proud cosmos
#

It just doens't work

#

idk

humble copper
#

oh

proud cosmos
#

my code is super broken somehow

#

It like kinda got something but the coordinates of scanners were wrong

woven sable
proud cosmos
#

so I changed it so it klnows where the sacnners are except now all the other stuff seems broken

humble copper
proud cosmos
#

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

woven sable
#

just so we don't need to spoilers everything

low condor
#

Completed Day 19!

woven sable
low condor
proud cosmos
#

It finally finds all the scanners at the right places but it finds way too few beacons

sleek cave
proud cosmos
#

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

low condor
proud cosmos
#

How long does your part 1 run

woven solar
proud cosmos
#

I mean I have one idea how to optimize it actually

#

I print ||scanner coordinates and the queue||

woven solar
#

my day19 takes like 30-60s? part2 is instant-ish once you do part1

proud cosmos
#

I see

#

I hope it is instant for me

low condor
proud cosmos
#

otherwise I'll cry

sleek cave
proud cosmos
#

I mena my code is just so bad but it should work theoretically

woven solar
#

||trees|| are poggers

proud cosmos
#

Please work for the love of god

low condor
#

|| The best solution is flat, just like the earth||

proud cosmos
#

I'll start trying to implement some optimization cause this is gonna take awhile

sharp panther
#

||the earth is not flat smh||

proud cosmos
#

It's a doughnut

sharp panther
#

||if only it was a tree||

sleek cave
proud cosmos
#

A doughnut is extremely accurate if you think about it

#

Red filling, ball shaped, stuff on top

low condor
woven solar
#

I think the topology is wrong for that lol

low condor
#

I was thinking ring donuts and was confused lol

proud cosmos
#

Only if you think about the wrong donut

woven solar
#

what's the right one

sleek cave
proud cosmos
sleek cave
#

oh

woven solar
#

hmm

low condor
#

If you reheat a jam doughnut in a microwave, the jam inside is as hot as the centre of the earth

proud cosmos
#

Sounds about right

sleek cave
#

that's what they're supposed to be called smh

proud cosmos
#

Yes

#

Might as well rename mugs as well

#

Still running btw

low condor
proud cosmos
#

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

robust heart
#

ok I think I'm getting the grip at day 12 (FINALLY)

molten crow
#

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

devout tusk
#

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!

proud cosmos
#

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

devout tusk
#

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 pithink

proud cosmos
#

That sounds close to impossible to create though

#

making puzzles is pretty hard

woven solar
#

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

devout tusk
potent pumice
#

somewhere I read it takes 6 months or something

sharp panther
#

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/

sonic silo
#

i wanted to build one

pallid quail
#

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.

woven sable
#

those*

pallid quail
#

I was going to just link to my github.

#

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.

low condor
#

@pallid quail without going too deeply into it, your code looks pretty clean so that's a plus

pallid quail
#

Thanks - glad to hear that. Been putting effort into that - not sure if I am following all of the proper python style conventions though.

low condor
#

If you are ever unsure, there's a handy song for that :)

pallid quail
#

haha nice

#

I'm especially proud of day 2, where I wrote my first recursive function - did that again on the day 3 solutions.

low condor
#

This year is partly Advent of Recursion

#

I've written a lot more recursive solutions than I've done before

pallid quail
#

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.

low condor
#

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

pallid quail
#

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.

proud cosmos
#

Nice!

wooden jewel
pallid quail
sharp panther
pallid quail
#

neat - I'll have to look into that.

glad tartan
woven sable
pallid quail
#

I've posted my day 3 solution

#

I think its my best code so far!

sleek cave
sharp panther
#

took me a while too haha

#

I only saw it in the channel description for black

limber needle
#

yeah really easy to use

#

just do black <filename>.py

sleek cave
#

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

sharp panther
#

oh wait, does that mean the same thing as "rtfm"?

#

woops

sleek cave
limber needle
#

rtfmdebatable

sleek cave
#

congrats

limber needle
#

i've learned it as Refer to the following documentation

sleek cave
#

hm, debatable indeed

#

i'm not sure then

limber needle
#

and that's why people send a link along with "rtfm" or "rtfd"

sleek cave
#

pretty sure rtfm is not refer to the following manual

pallid quail
#

lol

limber needle
#

contextual i guess

sleek cave
limber needle
#

if i'm not being passive aggressive i think it's fine

sleek cave
sleek cave
#

lol

sharp panther
sleek cave
#

i'm pretty sure kat said there was a filter for rtfm

sharp panther
#

there may have been at one point

sleek cave
#

yep, DATA got filtered

sharp panther
#

now that one did ping, thanks

sleek cave
#

oops sorry!

sharp panther
#

all good haha

sleek cave
#

i may have gotten the two mixed up - DATA is the one being filtered and pinged

minor cave
#

rtfm in a link won't ping iirc, I don't remember if regular rtfm pings

sharp panther
#

it does not, although I should probably suggest that

minor cave
#

Sometimes rtfm is referred to in actual docs, so I think we did have it at one point but it was too noisy

sleek cave
#

what is the regex for DATA? the whole thing or just d ontasktoask.com (added space so no potential ping)

minor cave
#

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

proud cosmos
#

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

wooden jewel
#

yeah it's genuinely useful advice in a vacuum

minor cave
#

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

sharp panther
#

I think the website is written fine, it's the dismissive manner in which it is dropped that becomes a problem

limber needle
#

does XY problem get flagged

minor cave
#

!xy

marsh currentBOT
#

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/

minor cave
#

I hope not =P

limber needle
#

anyway

minor cave
#

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

limber needle
#

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

wooden jewel
#

Yeah, I really like the fact that everyone is mostly on the same day, makes discussion for that day much more productive

sleek cave
#

so someone who's just starting to be on the internet could have a bad experience

proud cosmos
#

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

sleek cave
sleek cave
proud cosmos
#

Yea

sleek cave
#

what.

#

i've never heard of that

wooden jewel
proud cosmos
#
r"\[((?R)|\d+),((?R)|\d+)\]"
#

Here is some

limber needle
#

ooo interesting

proud cosmos
#

||Used it for day 18 to parse the snailnumber||

low condor
#

I used recursive regex in ||2020||

proud cosmos
#

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

sleek cave
limber needle
#

||same, ast.literal_eval for me||

sleek cave
#

lmao

proud cosmos
#

Honestly maybe smarter but eval bad

#

And regex is pretty cool

sleek cave
wooden jewel
#

||json.loads anyone?||

sleek cave
#

i should learn recursive regex

limber needle
#

functions exist so that we can use them grin_dog

proud cosmos
#

It's cool but I also just noticed that loading it as ||JSON or literal_eval|| is like 100% easier

#

Still like it though

sleek cave
#

wait, ||json can load lists?||

wooden jewel
#

||yeah json has lists||

sleek cave
#

okay ima go do d15 now to get my missing stars

#

bye

placid lake
#

it's time to.. refactor my horrific solution for today

sleek cave
#

okay there is no way im brute forcing d15

#

||but i don't know how to implement a* 😔||

#

time to learn it

limber needle
#

||Check outheapq module||

minor cave
#

<@&831776746206265384>

topaz summit
#

!shhh

marsh currentBOT
#

✅ silenced current channel for 6 minute(s).

iron shadow
#

!unshh

marsh currentBOT
#

✅ unsilenced current channel.

limber needle
#

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

proud cosmos
#

You can prob dop that for many days

#

not sure if you want to though

wooden jewel
#

today might be a good candidate?