#advent-of-code

1 messages ยท Page 48 of 1

magic scaffold
#

Hmm it's practice, a lot of it

#

The thing is most of the top scorer have already solved a problem like that so they don't think how to solve it they just modify the solution they have to fit the question

honest nacelle
#

some of them do look like certain classical problems I've heard of, I suppose if you know a lot of those you can fit them over a lot of different things

#

I definitely get the sense of intuition about certain puzzles, which is cool to get some introspection into

magic scaffold
#

Yup that's the thing
Just grind the question, and we'll get there ๐Ÿ˜€

honest nacelle
#

I'm so damn close to the answer, I can feel it at the tip of my brain meat. Common brain make that connection

woven sable
#

I think the questions people might also have existing code

#

||Like last year with modifying pemdas if I did it this year I already have code for making a calculator so I would just edit it||

low condor
#

||Also I went back and did that one with Lark Parser which was also very fun and very easy to do||

woven sable
low condor
woven sable
honest nacelle
#

lol

magic scaffold
woven sable
honest nacelle
#

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH I THINK I GOT SOMETHING

magic scaffold
#

Shit sometimes using regex for stuff can be a real nightmares sometimes ( looking at you web scraping )

magic scaffold
honest nacelle
#

to be fair, that's more the fault of english than regex

#

I don't quite know WHY it works but it does so now I just have to code it

magic scaffold
#

Just do it !

woven sable
#

@low condor Where's the || calculator tutorial|| on Lark Parser?

#

I can't find it

low condor
woven sable
#

Ahh it's in the GitHub I see, thanks

sleek cave
#

i had to go get something, now after a naive solution on part 1 i arrive at part 2

#

this shall be fun.

low condor
#

Classic AOC

#

When I read Part 1 I knew what Part 2 would be

sleek cave
#

same lol

low condor
#

Yet tragically I could not code Part 1 in a way that would help me for 2

#

until I actually did it naively

sleek cave
#

i was like, hm, exponential growth? part 1 also seems deceptively easy...

low condor
#

It's like I have to do it the dumb way until I can realise the smart way

sleek cave
#

yeah, sometimes that happens to me as well

#

||okay, so similar to lanternfish, any array/string simulation is out of the question. i'll have to find a purely mathematical solution (unless there is optimization on the naive sol??? this is so fun lmao)||

magic scaffold
#

For this ?

gleaming token
magic scaffold
#

LOL

sleek cave
#

@low condor i have been dragged into recursion hell

low condor
#

Goddamn

sleek cave
#

this might not even be the right approach, but I'm yoloing at this point lmao

sinful pawn
#

oh gosh. y'all write in code

sleek cave
#

okay now time to โค๏ธ generalize โค๏ธ

sleek cave
#

programming is a way of life lmao

sinful pawn
#

๐Ÿ˜ฉ

magic scaffold
#

Should this be here though?

sleek cave
#

moving to spoilers

honest nacelle
#

OOOOOOOOOOOOOH MY GOD

#

okay so what i did worked but I legit have no idea why

fossil cipher
woven sable
#

the feeling of finishing a day is just ๐Ÿ˜Œ

sleek cave
#

3 hours and a half.

maiden brook
#

it's recursion all the way down

sleek cave
#

i finally did it...

low condor
#

did you use recursion?

sleek cave
#

i still have homework to do, will share my solution later :P i have quite a lot of stuff to deal with at the moment, a bruh moment just happened, brb

low condor
#

Advent of Recursion

dusk socket
#

lol

#

I didn't use recursion, I used the same method I did with the fish problem - as I learned with previous AoCs - the secret is Dictionaries

jade root
#

yeah how do you learn a language without a dictionary

sleek cave
#

i was so desperate at hour 3 that i just didn't care about readability anymore

velvet stag
#

35 minutes

woven oriole
abstract bluff
#

7 minutes left

muted aurora
#

ye lets go

#

hopefully no stupid typos today

abstract bluff
#

hopefully no more memory opt. questions

muted aurora
#

if anyone wants to get on a call and work on it together at midnight feel free to hmu

abstract bluff
#

im willing to

hollow wharf
#

use pycharm and sublime text bruh

prisma sundial
#

gl

velvet stag
#

35 seconds

hidden copperBOT
sinful pawn
#

oops

honest nacelle
#

oh hell yes now this is in my wheelhouse

humble copper
#

oh god

honest nacelle
#

(famous last words)

humble copper
#

im not liking this at all

placid lake
#

i see ||weighted pathfinding|| HappyCat

#

anyway, time to sleep

#

this'll be a fun one to do in the morning

gloomy kernel
#

Less go

lapis jay
#

points!

gloomy kernel
#

I suck at Aoc's lol

humble copper
#

i will do this tomorrow

#

i suck at this and have no idea how to do it

stable heron
#

GAH

#

im on windows

#

so ima do it later

#

๐Ÿ˜ญ

devout tusk
#

Moving up is allowed, right?

magic scaffold
magic scaffold
peak dock
sonic silo
#

why

#

does it work for the sample

#

but not for the real input

magic scaffold
#

edge case

sonic silo
#

yeah no i dont have time for this

#

i will take on this later, but i guess this means losing a lot of positions

limber needle
#

i think solving them alone is big achievement

sonic silo
#

i mean sure, but its kinda frustrating that ive already visited this exact problem twice and yet i cant solve it

magic scaffold
#

more practice, more practice

uneven hollow
#

does day 15 required graphs?

limber needle
#

i did it without

magic scaffold
#

no its not necessary

uneven hollow
#

hmm ok

#

thanks

#

finding all possible paths would take too long

earnest forge
#

Yes

pearl moon
#

Hmm I naively thought I could do ||DFS for all paths|| :/

#

Now I have to sit around and figure out the optimal solution

#

Why the heck is ||DFS so intensive for such a small graph||

peak dock
pearl moon
#

I can't go to the spoiler channel because I want to figure out the solution myself

earnest forge
pearl moon
#

Do I need to implement ||seam carving|| or is there another optimal solution I'm missing

tiny pumice
#

How to activate the easter egg in day 12?

jade root
#

how do i even day 15

jade root
tiny pumice
#

Ya, when you hover over submarine's subterranean subsystems subsisting suboptimally, you get sublime shown up, but I feel there's something more to that.

#

@jade root

jade root
#

ahh

earnest forge
#

That's just one of the things that gets highlighted after day 25

#

It's just because it's alliterative

#

Usually those aren't left in until after you've completed the year though

tiny pumice
#

oh ok

#

tysm

livid gull
earnest forge
#

I mean I've looked at the page source for a few days and it literally wasn't there

#

Maybe it depends on the day

livid gull
#

I havent seen any in todays or yesterdays but they were there on other days in source code

sonic silo
#

fuckin hell

#

part 1 already worked

sleek lark
#

hmmm. This one seems a bit time consumming. I would like to know some information from those who already did it : Is there cases where the least resistance path goes away from the ending point ?

muted aurora
#

you can't assume it will always just go down and right

sleek lark
#

So brute force it is !

earnest forge
muted aurora
sleek lark
earnest forge
muted aurora
#

not necessarily, there's been quite a few problems where naive brute force has been fine

earnest forge
#

Yeah but at the same time it's far from the status quo

#

There have been at least 4 problems I remember where part was just 'ok now do it a ludicrous amount of times'

muted aurora
#

sure, but let people figure that out themselves if they want to try a brute force approach

#

at least if it's not the spoilers channel

candid berry
humble escarp
#

Can we cross over an already visited cell in this exercise? They don't exclude it but also don't give how we should handle those cases

#

or is it too early and I need a coffee and to read again the exercise

earnest forge
gloomy kernel
#

Imma use co pilot jk

humble escarp
earnest forge
mystic gull
#

||is it supposed to be 17 or 16?||

earnest forge
cursive temple
earnest forge
#

Ah right that's after the whole set of instructions

mystic gull
#

forgot bout that

eager lake
#

I'm on day 15, getting the correct answer for the sample puzzle, but the wrong answer for the input :-(. Anyone else have the same problem?

bright spindle
eager lake
earnest forge
#

Did you ||forget that you can go up and left too||?

eager lake
#

|| it chooses the lowest cost cell (so far) finds adjacent cells and updates the costs of those before putting those adjacent cells back onto the priority queue. So I think it should try all directions. ||

#

|| I suppose i'll have to try and create some other samples that break ||

sick crag
#

||make sure you count the end but not the start||

bright spindle
eager lake
#

@bright spindle thanks, much appreciated

pallid shoal
#

Hi

robust heart
#

Guess my cap for AOC will always be day 10 haha

#

I'm late by 6 problems Idt I'll catch up at this rate

#

Day 10 is essentially building a bracket pair colorizer

sleek lark
robust heart
sleek lark
robust heart
#

More about moving on a map. Day 9 part 2 was a nightmare

proud cosmos
#

I''m sad

#

I wanted to implement a weird algorithm I know of for fun

#

but because the numbers are so tiny it's actually reallly bad

#

even if there are no errors which I am not sure since it never finishes

#

Pretty sure that solution needs to go through all points I visited before once for every value of that number

#

so it's probably like hyperexponential

#

Good stuff

sleek lark
#

The sickness got the best of me. I can clearly visualize the algorithm but implementing it is hell.

hollow wharf
#

How do I get Advent of Code role?

proud cosmos
#

send help i'm strugling

loud yew
#

todays problem will be my โ˜ ๏ธ

#

mostly because it takes a hard thing (pathfinding in this way) and combines it with a super hard thing (optimization for memory) fuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu

sleek cave
#

ahhhh I want to use ||recursion and DFS|| again halp

#

I'm actually obsessed

bright spindle
woven sable
sleek cave
#

lmao

bright spindle
final berry
hollow wharf
bright spindle
#

Oh right, there's a participant role as well, forgot about that, sorry

final berry
fervent talon
#

Question regarding day7 puzzle. Crab at some position with value 0 can't be moved anywhere, because he has no fuel, correct?

sonic silo
#

he whole value 0 just implies its at position 0

fervent talon
#

are you sure? based on the example you are incorrect

proud cosmos
#

Move from 0 to 2: 2 fuel

#

how would it move 2 spaces using 2 fuel if 0 meant 0 fuel

fervent talon
#

Ou. I am blind

#

On the other hand Move from 16 to 2: 14 fuel so it reads, I had 16 fueld, I moved 2 positions to the left to reach closest 2 and now I have 14 fuel

#

Or maybe I am missing something

#

@proud cosmos

proud cosmos
#

No it moved from 16 to 2

#

using 14 fuel

#

The example starts with this line

#

For example, consider the following horizontal positions:

16,1,2,0,4,2,7,1,2,14

fervent talon
#

Okay

#

But it also says "Each change of 1 step in horizontal position of a single crab costs 1 fuel"

#

So where did it move 16 in this example for it to cost 14 fuel?

#

I feel it is like abs(move what position - to what position)

#

Therefore 1 -> 2 = 1 and 0 -> 2 => 2 as is 4 -> 2 = 2

bright spindle
fervent talon
#

Okay. So it doesn't mean
16,1,2,0,4,2,7,1,2,14
0,1,2,3,4,5,6,7,8,9
And that 16 at position 0 moves to position 2
-----^
?

#

Sorry then. Understood it wrong way

bright spindle
#

No, each number is a position along a number line

fervent talon
#

I see.

#

Then my approach is completely wrong ๐Ÿ˜ฆ

bright spindle
#

So like, 16,1,2,0,4,2,7,1,2,14 would be

      *
   *  *
*  *  *     *        *                    *     *
_________________________________________________
0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16
fervent talon
#

What are *?

bright spindle
#

Crabs

fervent talon
#

Ou. Gotcha

#

I was trying to approach it that way, but doesn't seem to work. I calculated position frequencies aka how many crabs at each position.

#

I selected 2, that had max.

#

But both of them give too high fuel costs

bright spindle
#

I mean, I'm just illustrating what the numbers mean, I'm not saying a frequency distribution is the way to go

#

||The least-fuel position is probably not just the position with the most crabs at it||

fervent talon
#

^ that is true. Was just my assumption based on example, but now I see, that it is wrong.

#

I have idea for other approach, will try that one.

bright spindle
fervent talon
#

Mhm. Thank you @bright spindle

bright spindle
mint marten
#

ok tq

velvet stag
#

today was too hard

#

80% sure there won't be another hard one this year

#

this was the peak

#

screen it pack it whatever the phrase is

ruby epoch
#

Isn't day 20 usually the hardest one?

fervent talon
#

@bright spindle one more question regarding it. Is my understanding correct, that available positions where crabs can move are from lowest present position to highest present position? Or can they be completely random and be outside the range of given positions? Also can they be only positions of mentioned crabs or in case of such example 1,2,5,7 I can consider moving them to position 4?

bright spindle
fervent talon
#

I see.

torpid elbow
#

Today's problem is out of reach for me... I have no idea how to make a path finding algorithm

bright spindle
stable heron
#

๐Ÿ˜ฉ

#

i didnt even start

tight dune
#

i dont even know what's the question yet

livid gull
#

I've done 25/25 on AOC 2020, whats the order of difficulties of the other years?

sonic silo
#

i dont feel like, if youre doing any of the previews years without the time limit, theres any particular order tbh

#

you could try to do puzzles as you see fit from several years at the same time

velvet stag
#

2019 was very tricky

#

earlier ones i don't know tbh

ruby epoch
#

2019 was the one you had to write your own computer for intcodes and it built on your logic each day, right?

#

(note: I've not done aoc19, that's all hearsay)

rapid wolf
#

yup

#

it's really fun

stable heron
#

For todays challenge do we need to use A* or Dijkstra's algo?

peak dock
stable heron
#

o.o

wooden jewel
#

wait

#

Is intcode turing complete

#

if so

#

aoc

#

in intcode

bright spindle
#

Yes, it is.

#

As of day 5

wooden jewel
#

๐Ÿ‘€

bright spindle
#

@earnest forge is referenced in there ๐Ÿ˜›

woven oriole
#

i am very suspicious about the fact that the dijkstar algo will cover all nodes without getting blocked by four already visited nodes

#

does it always work \๐Ÿค”

mossy basin
#

why would it get blocked

woven oriole
#

you are restricted to 4 movements up right left bottom , everytime you leave a node it is marked in visited

woven oriole
#

so how is it ensured that we will never end up getting all moves blocked

mossy basin
#

if four visited nodes are neighbors, then their neighbors would be on the priority queue

#

you don't get blocked

woven oriole
#

oh understandable

#

so can we call this as a direct implementation of this algo or some tweaks are required

mossy basin
#

probably should ask in spoilers

woven oriole
#

yes lol

dim wing
#

Hey guys, im pretty new to AoC, so where can i know project to do for the AoC ?

#

Sorry if this isnt right place to question

fervent talon
#

It is right place.

rancid creek
sonic silo
#

i really love aoc2019

earnest forge
hearty shuttle
#

hey folks. trying to pick back up AOC somewhat, had a question day 6 part 2. (dont want answers). im guessing brute force wont really work? I've currently* got it brute forcing and i've got a bad feeling about it

proud cosmos
#

so probably not

hearty shuttle
#

yes fish

hearty shuttle
#

11 tb..ok great.

#

ty

proud cosmos
#

Darr right now: brb buying 11TB of ram

minor cave
#

Yeah, if it's taking longer than 30 seconds, it'll get to like... iteration 200 and then really start slowing down and then really start consuming RAM

hearty shuttle
#

you know, i thought about it ๐Ÿ˜›

earnest forge
hearty shuttle
#

not yet, ty. let me bang my head for a bit

hollow wharf
#

fuuuuuuuck day 14 part 2

#

and of course day 15 is ||path finding||

#

fuuuuuuuuuuuuuuck

#

I was so happy about my part 1 solution

velvet stag
#

but still hard

hearty shuttle
#

MemoryError i take it we lost a lot of folks on day 6

gleaming token
#

doesn't look like it

minor cave
#

That's actually quite a lot when comparing to the day before and after. Many people didn't complete pt 2

gleaming token
#

the day before went down by 10,000 people..

#

5 to 6 was 2% decrease

minor cave
#

But day 6 in that screenshot has the most people who completed 1 star but didn't complete the second. There will be a natural decrease as the days go on due to increasing difficulty but also people not having as much time available

hearty shuttle
#

i did it.. i created some kind of frankenstein monster that still took a few years to run but it got me an answer

#

now i need to figure out what was the right way to do it.

low condor
#

Is this Day 15?

hearty shuttle
#

mine? no, im on day 6 now ๐Ÿ˜…

low condor
#

ah ok XD

hearty shuttle
wooden jewel
hearty shuttle
#

part 2. i did do it, but my solution is terrible

rancid creek
hearty shuttle
#

im afraid to click that to be honest..tricky

#

i dont wish to get spoiled for anything i havent done yet

sonic silo
#

a lot of people couldnt even solve part 2 for day 3

#

then day 4 hit em

ruby epoch
#

โœ‹ That's me. I struggled with 3B quite a lot - and even now it only worked for one account instead of both of mine. And I'm still working on 4B here

hollow wharf
#

๐Ÿ‘€ is it working?

#

lmfao nooope

#

OH my god

#

๐Ÿ‘€

#

it works on the sample input

sonic silo
#

hmm

#

surprisingly enough i believe today to be another dip

hollow wharf
#

yessssssssss

#

first part done

#

okay

#

part two doesn't sound that hard

woven sable
#

because I've never touched pathfinding ever

hollow wharf
#

oh, it is once again a ||if you haven't optimised your solution get rekt|| thing isn't it

woven sable
fossil cipher
hollow wharf
#

I think my solution is good enough here

#

at least I hope

#

I hardly see how I can make it faster

woven sable
#

How fast did it run?

#

if it's below a second I think you'll be fine

hollow wharf
#

||It is A* with a sorted open set||

#

0.15s lol

woven sable
#

Someone had a 0.2 second sol and it ran in 6.1 seconds

hollow wharf
#

wait it wraps around to 1 and not 0

#

how do I make that with a modulo operator lol

low condor
#

It's probably easier just to code it separately than use modulo - that's what I did

hollow wharf
proud cosmos
#

There is a relatively simple way with modulo as well

#

|| number-1 % 9 + 1||

hollow wharf
#

aha

#

5.3s on part 2

#

gud enuf

hollow wharf
#

(crossposting from the spoiler chat)

sleek cave
woven sable
#

the current image right now

crisp coyote
#

Why am I seeing a crocodile wearing sunglasses

woven sable
hollow wharf
#

It is a dragon guys

#

no way around it

woven sable
#

crocodile I can see, but a dragon?

#

oh wait no I see it

#

a dragon with snot coming out?

hollow wharf
#

yes

bright spindle
humble copper
#

god i hate that gif but its exactly how i feel rn

hollow wharf
#

.aoc join

woven sable
sleek cave
gleaming token
#

you can do recursion

#

I don't see why not

woven sable
fossil cipher
# woven sable

I bet there's a Ghost Leviathan in there, somewhere...

gleaming token
hidden musk
#

stack overflow? who's she

sleek cave
#

just finished a big school project due tomorrow holy crap

#

took 3 hours

#

I won't have time to do today's aoc puzzle lemon_pensive

sleek cave
#

although that is true, in the previous puzzles I used recursion but the call stack was never thousands upon thousands

sleek cave
#

i'm tired, spent 30 minutes on d13 bc silly me thought it was easy

#

me brain is unresponsive, the latency is too high

#

turns out a naive solution won't cut it

#

ahhhhhh

#

i shall sleep now, goodbye

worldly gull
#

There is a smart way to do today's puzzle

#

I did not do the smart way.

#

I am currently at 190000 nodes visited. Only about 20 more minutes until I can know if I got it right. ๐Ÿ˜›

torpid karma
#

Im confused on day 13, what should the output for part 2 be?

#

it says 8 letters but my data is not showing any letters

#

nvm my code has a bug

#

lol i still had all the code still only looking at the first instruction when comparing when looping though all the instructions

worldly gull
#

Finished day 15 after my poor computer crunched numbers for the better part of an hour. ๐Ÿ˜„ Can't wait to see what's the not-dumb way to do this.

unique osprey
sleek cave
unique osprey
#

but i found the slightly more optimized version

maiden brook
unique osprey
#

after, lol

worldly gull
#

I mean I have multiple cores, I could still use my computer ๐Ÿ˜›

unique osprey
#

i was working my job while it was running

maiden brook
#

oh, nice job, still

sleek cave
rancid mural
#

still haven't got part 1 done. my code works with the example but gives a too high answer on the real puzzle

#

but my real puzzle answer was off by 1...

#

i know i'm not counting the origin point. where could the extra one be coming from

#

the extra point isn't there in the example

#

once again, in part 2, the example works but the puzzle answer is wrong. but it's off by more than 1 this time

velvet stag
rancid mural
#

for me it's not the sample

velvet stag
#

like you should just set the first cell to 0 to be safe

rancid mural
#

i'm doing that. in two places, even, both my starting seed before the loop, and in __getitem__

velvet stag
#

ok, well you may be just solving it wrong

#

you can dm me code if you want

rancid mural
#

indeed... i'm doing a variation of the flood fill thing i did during the basin detection

#

let me get it on github

abstract bluff
#

can't wait only 50 minutes left

tranquil cargo
#

I just joined and saw you guys doing this. Didnt realize it was so active. Just starting

humble copper
#

would it be a good idea to store useful general-use functions in a module to use for next year's aoc

#

bc that's what im planning on doing once this year is done

#

to make next year easier if theres any similar problems

sharp panther
#

Why not? And if not AoC, you might have them as a reference anyway for something else.

sonic silo
#

wao

#

just 2 more mins

prisma sundial
#

gl

woven oriole
#

.aoc c

hidden copperBOT
#

Day 16 starts <t:1639630800:R>.

sinful pawn
#

oops

foggy zealot
#

second

stable heron
#

o.o

bitter prism
stable heron
#

damn this is a long read

sonic silo
#

yep

ripe ingot
#

what are we supposed to do exactly?

humble copper
#

ok this looks difficult but fun

humble copper
rotund rapids
#

holy, this might require a good sleep to start this one

humble copper
#

yep im definitely starting this tomorrow

ripe ingot
stable heron
#

I dont get it

#

isnt there just one packet totally?

sonic silo
#

i like this

stable heron
#

like is the entire input one packet or what?

#

I didnt get the hierarchy thing

fringe temple
#

i have the same question actually. i thought the input would be multiple lines of the hex transmissions in the examples

stable heron
#

OHH nvm I got it

#

each "operation" bit has several sub-packages

#

and each sub-package can be another operation packet

#

and so on

fringe temple
#

oh ๐Ÿ˜ฌ thanks

tranquil cargo
#

What level of challenge should I expect through this

#

Day 1 and 2 have obviously been easy. But I dont feel like getting into this then suddenly day 14 takes 8 hours of intense thought and algorithms research

#

4 hrs is acceptable /s

#

I guess what im getting at: does it become "a second job" or a fun programming exercise for after dinner

teal basalt
#

why do we split the next 27 bits of data into 11 and 16?

lapis jay
#

WHY AREN'T THE SUB LITERALS PADDED TOO

#

/rant

pearl moon
#

AoC has been second job territory for the last few problems for me :/

sonic silo
#

:stress:

#

what the fuck

pearl moon
#

Yea I'm not understanding how to break up the subpackets lengthwise

#

Why is it 11 and 16!?!?

#

Maybe it's supposed to be 11 bits per packet but you're not allowed to leave off bits at the end....so they do 11, then 16 are left but they can't just do 11 and leave 5 dangling? Must be combined with the last packet?

woven oriole
#

how will be decide how many packets are there

#

like differentiate every single hexadecimalcode

livid gull
prisma sundial
# pearl moon Why is it 11 and 16!?!?

for the 11 packet, you get version=6 from first 3 bits of AAAAAAAs, then type=4 (literal) from next 3 bits, and then you parse in 5 bit chunks until you get a chunk where the first bit of those 5 bits is a 0

#

all together this is 3 bits + 3 bits + 5 bits (because first such chunk starts with a 0)

#

therefore 11 bits, continue parsing next packet from there

pearl moon
#

Ohhh right

prisma sundial
#

(for a total of 27 bits at max, since the parent pack said all together the children at 27 bits)

pearl moon
#

Nested parsing

woven oriole
#

ohh

#

thats why

#

got it

#

sub packet stumped me

prisma sundial
#

yeah this is a recursive problem

pine tiger
#

hey

#

can someon tell me

#

what literals this is supposed to contain

#

getting 13 instead of 12 and i'm dying

stable heron
#

12 this the sum of versions

#

also how do you know the size of each individual sub packet in a operator packet with type 0?

#

ie you know the length of the subpackets

#

ohh nevermind

#

i got it

devout tusk
#

is it just me or the question is worded weirdly?

late frigate
#

it sure is a reading challenge

stable heron
#

gosh this is confuuuuusing

iron reef
#

This was so tedious

pearl needle
#

it's a heavy problem, especially if you don't have any experience with parsing binary data streams

iron reef
#

Completely different style of problem from every other one this month

flat sequoia
iron reef
#

Literally just a bunch of subclauses to waste time

flat sequoia
#

i thought it was pretty fun

#

although i didn't do too well today

iron reef
#

Million different rules and miles of reading

stable heron
#

its really fun

iron reef
#

The other ones you could blaze through after you figure them out

stable heron
#

but im kinda slow

#

ngl

iron reef
#

This one was pure slogging

pearl needle
#

the rules were pretty simple, but they had a lot of example text

flat sequoia
#

i spent 15 minutes today debugging some shitcode because i had == instead of !=

pearl needle
#

I assume to help out people unfamiliar with this kind of stuff

flat sequoia
#

man my first implementation of this was absolutely garbage because i wasn't passing around a mutable object

#

i haven't really done much parsing before

woven oriole
#

one ques, if length type is 0 and
if the 15 bits length is an operator packet then is it assured that the complete length is an operator packet

#

or can it include like some length of operator + some length of another operator

#

or some length operator + another literal

hazy pendant
#

looks at day16
sees computer networking

ah shit, here we go again

wooden jewel
#

of_happenings.gif

#

I think we found the recurring theme for this year

ember cargo
#

Where's it getting 11 bits from?

#

How does it know to count 11 bits after L

sonic silo
#

its parsing a subpacket of type id 4

ember cargo
#

Oh

#

Wait do subpackets have subpackets within them or do I not need to worry about that?

#

Do I just need to look at VVVTTT for the subpackets?

sonic silo
#

yes, theres packages within packages

ember cargo
#

Oh I see, it gets the values of that

#

Yeah so
1101000__1010__
is value 10

#

Kk ty

devout tusk
#

can someone explain the "8A004A801A8002F478" example case in detail. I am thoroughly confused

woven oriole
#

๐Ÿ˜ข

dusk cove
#

finally ๐Ÿ˜ซ

dusk cove
uneven hollow
#

nice

#

how do we know when literal packets end?

#

like it says theres a trail of zeros

#

yeah but there will be a trail of zeros

#

oh

woven oriole
#

yes

uneven hollow
#

ok thanks

woven oriole
#

REDACTED

uneven hollow
#

okie

woven oriole
#

nvnm

bright spindle
#

Please refrain from discussing solutions to the current day's problem in this channel.

bright spindle
woven oriole
bright spindle
bright spindle
#

I feel like today's puzzle is closer to what real-world software development is generally like than most.

#

Assuming you don't work in a particularly math-heavy domain, I mean.

#

And even then you probably often have to do stuff like this, anyway.

woven oriole
devout tusk
#

For those who didn't understand the question and want a hint. Here it manually shown on an example case

marsh currentBOT
#

Hey @devout tusk!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

โ€ข If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

โ€ข If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

woven oriole
#

f

devout tusk
#

wtf

woven oriole
#

DO IT I NEED THAT EXAMple

devout tusk
#

lemme dm it to you then

unreal willow
ember cargo
#

A bit unsure

#

How does it know where A ends

sinful pawn
#

oh, I doubt I know the context for this lol

ember cargo
#

Mb sorry

uneven hollow
#

yeah

ruby epoch
#

!rule 9

marsh currentBOT
#

9. Do not offer or ask for paid work of any kind.

peak dock
#

We do not allow asking for paid work.

strange zinc
#

so, packet has sub-packets, which can contain sub packets and so on?

peak dock
#

yes

sleek cave
#

OMG I LOVE LOVE LOVE LOVE LOVE AOC

#

PARSING BINARY

#

BRO WHY ARE THESE PUZZLES SO GENIUS

#

and this one is so real-life as well...

hollow wharf
#

wut

woven sable
tight dune
#

why did i drop aoc yesterday today's problem seems interesting ๐Ÿ˜”

proud cosmos
#

You can still do it

tight dune
#

i suppose i could

noble skiff
#

To me today's problem seems like such a grind

wooden jewel
#

It's just a lot of explaining

noble skiff
#

Hah yeah. I was losing interest a bit halfway down the page

wooden jewel
#

(and I have a sneaking suspicion we're gonna extend this in the coming days)

noble skiff
#

Also for those who are curious, this isn't realistic, no

#

These things are not recursive in real life

honest nacelle
placid lake
#

i woke up this morning and tried reading through todayโ€™s puzzle.. that was horrible lol

noble skiff
#

yeah, same

hidden musk
#

first thing I do is scroll down to get the input and I thought "damn, I scrolled for way longer than usual"

ruby epoch
#

That's a worrying sign

mossy stream
#

why do I feel like I'm reading the USB docs once again

#

Well that surely isn't the last puzzle on this

bright spindle
#

One packet at one layer can contain multiple packets for a higher layer.

#

This is not that different from unwrapping such packets, though there's a lot less detail in the AoC case of course.

proud cosmos
#

Good old internet packets

wooden jewel
#

takes me back to writing a dns resolver for my networking class

glad tartan
noble skiff
#

but that's not the same as it being recursive

#

I don't have much experience with parsing raw TCP/IP, just other protocols, so it's possible TCP/IP is recursive, I just never heard it described that way

#

also, the first part, and every single one of the given tests work perfectly, but I'm off on part b)... feel like I'm too tired to tackle this

woven sable
#

Are we at the peak of AOC? Sure feels like it

glad tartan
#

what books would people recommend for learning Python real quick?

mossy stream
#

automate the boring stuff with python, 100%

#

!resources we have a nice list of resources here

marsh currentBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

glad tartan
#

awesome thanks! ๐Ÿ™‚

mossy stream
#

why am I unable to convert hex into a string of 0 and 1

#

that's just crazy

#

I mean I could convert to an int but it doesn't seem very efficient

bright spindle
# noble skiff but that's not the same as it being recursive

I mean, it sort of is, lots of protocols support carrying same or lower-level protocols, like, you can carry link-layer frames inside IP packets, like a VPN, and you could connect to an arbitrary number of VPNs stacked on top of each other.

mossy stream
#

guess I could do that in chunks?

bright spindle
bright spindle
#

lol spoilers

mossy stream
#

that seems like a bad solution and yet I think that's what I'll be going for haha

glad tartan
#

it's not production code

mossy stream
noble skiff
bright spindle
noble skiff
#

TCP packets will carry arbitrary payloads which could themselves be TCP packets

wooden jewel
bright spindle
noble skiff
#

Because it's not? :-) it could be used recursively, it might not be, many of the people parsing said packets (most) will not be parsing recursively

#

If you have a class Foo with a Foo member, it's definitely recursive in structure

#

If you have a class Foo with an object member, I don't see that as intrinsically recursive

bright spindle
noble skiff
#

no, not really

bright spindle
#

Or a min packet can contain a max packet, which are not the same type.

#

That's like a Foo object containing a Bar.

noble skiff
#

The schema explicitly says that it can contain itself

bright spindle
#

So does IP

#

IP has a specific type ID for IP payloads

noble skiff
#

Okay, then that I was not aware of wrt IP

bright spindle
#

I don't see how it's relevant though, because any protocol totally can contain itself.

#

The spec doesn't forbid it.

sonic silo
#

much like how python has a debugger as well

wooden jewel
#

(I think it's also a case of "exception" vs "rule")

noble skiff
#

well, like I said, then it comes back to whether you consider

class foo:
    data: object

to be recursive

wooden jewel
#

(For these packets it's the rule to contain themselves, for IP it's an exception)

noble skiff
#

i definitely would not simply say "foo is a recursive type"

#

and I don't think most people would say that

bright spindle
#

Well, it feels like a meaningless distinction.

noble skiff
#

I'm pretty sure that most people will not think it's a meaningless distinction between foo and e.g.

class bar:
    next: Optional[bar]
#

one is explicitly recursive, there's no discussion or room for how a specific person uses it.
the other may or may not be recursive, it's a question of what additional schema is being attached to it, because obviously an "additional" schema beyond just the types specified here are required to interpret foo

bright spindle
#

Well, the original issue was whether today's problem is realistic or not, and while an explicitly recursive binary format may not be super common, decoding a nested and possibly recursive binary format is, which I'd argue is almost the same thing.

noble skiff
#

if a decent number of people have to actually take into account the recursiveness of IP packets, i.e. they have to consider what to do for that specific type ID, then I definitely agree with you

#

i don't have much firsthand experience with decoding raw IP packets

rapid wolf
#

most config formats these days are also recursive, and while you try to not implement a parser for those, sometimes a thing just uses a weird one you don't have a library for.

sonic silo
#

parsing is generally of recursive nature anyways ๐Ÿค”

#

also maybe we shouldnt talk about this in here but im not sure

noble skiff
#

i don't think there's any spoilers here

glad tartan
sonic silo
#

ยฏ_(ใƒ„)_/ยฏ

bright spindle
sonic silo
#

idk

noble skiff
#

if the client knows the type to expect it won't really look recursive

#

(unless the type itself is recursive ๐Ÿ™‚ )

ruby epoch
#

On day 6, should I be making my test data different days with the lists, or just use the day 18 with the int that the test data gives us?

eternal berry
#

I just got finished with day 6 solution 1 and the provided test data was more than adequate

#

Am I right in thinking day 6 solution two is all about optimisation? Trying to find out how many fish there would be after 256 days but my machine is on Day 152 now and it's almost ground to a halt ๐Ÿ˜„

woven sable
humble escarp
#

I'm confused about today's exercise

#

Why there are trailing 0 in the literal packets?

rancid mural
#

the only trailing 0s in mine are only because hex sttrings can only encode bits in multiples of four

humble escarp
#

ohh

#

To do this, the binary number is padded with leading zeroes until its length is a multiple of four bits, and then it is broken into groups of four bits.

#

"its" length means the WHOLE binary, right?

#

so it can be converted to hex

#

ok it makes sense

hollow wharf
#

I think so

rancid mural
#

after all this insane pathfinding and battling with factorial time, it's nice to have a good old-fashioned serial parser with an arcane format

peak dock
#

truee

bright spindle
eternal berry
#

Day 6 Solution 2 wasn't as hard as I thought it would be ๐Ÿ˜„

proud cosmos
#

All about finding a solution idea

hollow wharf
#

Man I havenโ€™t done AoC in ages. Stupid finals taking up all of my time.

restive imp
#

Now that's unfortunate... My program calculates the example of Day 15 Part 2 correctly, but the result to the input is wrong ๐Ÿ˜ฆ

fervent talon
#

Hey guys. I am struggling with Day 7 Part 2. Can anyone explain how those numbers are produced (fuel cost numbers)?

  • Move from 16 to 5: 66 fuel
  • Move from 1 to 5: 10 fuel
  • Move from 2 to 5: 6 fuel
  • Move from 0 to 5: 15 fuel
  • Move from 4 to 5: 1 fuel
  • Move from 2 to 5: 6 fuel
  • Move from 7 to 5: 3 fuel
  • Move from 1 to 5: 10 fuel
  • Move from 2 to 5: 6 fuel
  • Move from 14 to 5: 45 fuel

||
I did read explanation and my assumption was from this "Move from 16 to 5: 66 fuel"
That ABS(move_from_fuel_present - move_to) * (move_to + 1)

But I get results different from what example shows and when I looked at line 2, my assumption went into a trash.
||

bright spindle
fervent talon
#

oooou, thank you

#

|| I assumed you just take total so for 3 steps 3 || Thanks

bright spindle
#

||It tests whether your pathfinder can find paths that go up and left.||

restive imp
#

Its 315

bright spindle
#

||The correct answer is 29||

#

||So your pathfinder probably has trouble with paths that go up and left||

restive imp
wooden jewel
rapid wolf
#

yeah, this is about where people start dropping off in bulk

pearl moon
#

I gave up after about 45 minutes last night, just can't keep dedicating this much time

restive imp
mossy basin
#

i went to bed early last night, and woke up to this very long problem

woven sable
#

the only part that really matters is the first two paragraphs i think

#

the one that details operator packets and literal packets

mossy basin
#

i did finish it, i made a nice ast printer for it

woven sable
#

ahhh

#

nice

#

i should've gone with the ast way, i just did a ||recursive func||

#
Day   โญ  โญโญ |   %โญ    %โญโญ
================================
 1)  522   493 |  56.13%  53.01%
 2)  479   468 |  51.51%  50.32%
 3)  445   389 |  47.85%  41.83%
 4)  347   330 |  37.31%  35.48%
 5)  320   313 |  34.41%  33.66%
 6)  319   305 |  34.30%  32.80%
 7)  308   305 |  33.12%  32.80%
 8)  285   251 |  30.65%  26.99%
 9)  265   237 |  28.49%  25.48%
10)  248   240 |  26.67%  25.81%
11)  213   213 |  22.90%  22.90%
12)  199   190 |  21.40%  20.43%
13)  204   202 |  21.94%  21.72%
14)  202   183 |  21.72%  19.68%
15)  161   149 |  17.31%  16.02%
16)  113   104 |  12.15%  11.18%

we're almost reaching the amount of people last year (last year 90 people or so made it through AOC)

mossy basin
#

used ||StringIO|| to make the parser a little cleaner

woven sable
#

||how did you use StringIO? oh did you use it with the seek method and what not to made it nicer||

mossy basin
#

just use .read

woven sable
eager lake
#

I used a string iterator in a similar way. But the code's probably cleaner when you can choose a number of chars to read

mossy stream
#

it was paaaaaiiiinful

sleek cave
#

14 was pain but so fun

#

okay wtf is that drop from 15 to 16

low condor
#

16 is still in progress

woven sable
#

might be since the day isn't done yet

low condor
#

I'd say, don't overinterpret the stats too much

#

in the global AOC stats, there is a dip for day 5 and day 12

#

but both those days are Sundays

#

that itself could be factor

sleek cave
low condor
#

the biggest drop is from day 3 to day 4

#

and day 4 is a Sat

sleek cave
#

alright. 30 mins of finishing final homework before christmas break then it's advent of code time

sleek cave
woven sable
#

i think that's when we got giant squid bingo

#

hated that one

sleek cave
#

well, at least they tried the first three

woven sable
#

true

low condor
#

I loved it but just for the Star Wars ref

devout tusk
#

quit a huge drop of people overall since day 1! Almost 150k+!

low condor
#

otherwise, yeah, was not a huge fan of that one

sleek cave
low condor
#

is this your first year?

sleek cave
#

yep! that's why i love discovering aoc so much

woven sable
#

probably because i've never used numpy

sleek cave
#

(same with recursion)

woven sable
#

my favorite days so far have been recursion days

#

learned a lot about recursion with AOC

sleek cave
#

did you solve 14 with recursion?

woven sable
#

no, i'm pretty sure the stack would die haha

sleek cave
woven sable
#

correct me if i'm wrong tho

#

oh interesting

low condor
#

I quite liked Day 12 this year

woven sable
#

wait ,i mixed 14 with 15

low condor
#

mainly cos I did pretty well on that one XD

sleek cave
low condor
#

I loved it because it's one of the few ones that I got a pretty concise solution

sleek cave
#

i agree

woven sable
#

I loved day 12 too

sleek cave
#

then you look at salt who only writes a few lines (at least for the first 10 days) lmao

#

i love every single day

low condor
#

I only hate the days I get stuck on XD

sleek cave
#

lol

rapid wolf
#

yeah, this year is really fun

low condor
#

so far, none this year, though day 14 part 2 took me a little while

sleek cave
#

took me 3 hours to do part 2 lmao

rapid wolf
#

I got kind of stuck on bits, and hard stuck on today

mossy stream
rapid wolf
#

hmm, maybe not stuck

sleek cave
mossy stream
#

hmmmmmm

#

I don't think things worked out anymore

#

that's basically it

sleek cave
#

ah, i see

ruby epoch
low condor
#

if you hover over the text, there's hover text that confirms it

ruby epoch
#

Nope, I'm getting a complete different thing in my hover

#

"That's cuz a submarine don't pull things antennas out of their sockets when they lose. Giant squid are known to do that"

low condor
#

that's a star wars ref lol

#

I think you need to rewatch the OG trilogy ๐Ÿ™‚

tulip harbor
mossy stream
#

hahaha, my pleasure

sleek cave
#

passed day 13 as a warm-up :p

#

now for the real challenge: day 16.

#

i feel like d15 is when shit started to get real

#

total days spent in cave: 8

tulip harbor
#

I need to go back and finish 4 and 5 ๐Ÿ˜…

#

I tried to do a naive brute force of 4 and got frustrated when figuring out how to read the data took me all day.

#

plus it's on my home laptop and not my work laptop

sleek cave
tulip harbor
sleek cave
#

good luck!

tulip harbor
# sleek cave good luck!

thanks, things are a bit over my head now so I'm just having fun reading solutions and asking questions day-of. though I should probably do actual work during my working hours..

sleek cave
#

(ofc, you can get stars after, but the christmas spirit is now lol)

tulip harbor
tulip harbor
#

maybe I'll just stop with the evening vidyagames and focus on aoc instead.

#

it is funny how games lose my attention due to the FOMO of reading this channel on the day of a new problem

sleek cave
#

also why is day 16 so complicated-

#

i spent 15 mins just reading the prompt

noble skiff
#

yep

sleek cave
#

time to spend an hour and a half with pen and paper programming

woven sable
sleek cave
#

true

woven sable
#

it is so helpful though

#

helped me figure out my bug in my code

sleek cave
#

turing complete as well ||\s||

noble skiff
woven sable
humble copper
#

my function passes the example cases but not the real one

#

for part 2

woven sable
low condor
#

Happy to do the same as well ๐Ÿ™‚

sleek cave
#

i can now parse several literal packets in a row

#

but the operator packets... AHHHHHHH

woven solar
#

an operator packet is a header and some literal packets in a row

sleek cave
woven solar
#

true

sleek cave
#

which makes this whole thing extremely complicated

#

...or not

#

hold up

pallid stirrup
#

your name applies well here

sleek cave
#

recursion is my best friend

sleek cave
pallid stirrup
#

for some reason i rarely use it
my brain gets confused lol

sleek cave
#

same

noble skiff
#

well, it's a recursive data type

#

so, this is a very very intrinsically recursive problem, compared to any other day so far

#

other days, recursion was one good approach, but here the data itself will be recursive, no matter what approach you use to parse it, but obviously a recursive approach matches up especially well when you have recursive data

humble copper
#

man today was tough

sleek cave
#

NO WAY AHAHAHHAHAHAAAHHHHA

#

BRO

#

TWO HOURS AND A HALF WOOHOO

#

lord forgive me, i just wrote down the most horrendous spaghetti code i've ever written in my entire life

#

the euphoria is insane-

#

ON TO PART TWO!

#

this is the best christmas ever

humble copper
#

godspeed

sleek cave
#

SDAFJHLSDKJAFHKASJFHAKSJFHASKDJFHSKLJFH

#

HOLY INSANITY

#

I NEVER THOUGHT I'D GET THIS FAR INTO AOC

#

30 STARS

proud cosmos
#

Nice!

sleek cave
#

okay need sleep no time to unwind spaghetti

proud cosmos
#

More than half way

sleek cave
#

still gonna post the spaghetti code though lol, perhaps some experts can actually read it

woven sable
#

Congrats :D

sleek cave
muted aurora
#

My friend and I get on a call every night and work on AoC, it's actually pretty nice, if anyone wants to join feel free to add me / hmu

sleek cave
#

tysm y'all, this server and aoc are both absolutely amazing and y'all helped me so much during this adventure

#

30 stars, more than i ever wanted

#

i am euphoric

#

(is 40 within my reach? mayhaps...)

muted aurora
#

You can do 40!

sleek cave
# muted aurora You can do 40!

lol, i'm already spending average 3 hours on each puzzle now, i wonder how this will evolve once christmas break starts for me

#

i'll have no more homework and school so a lot more time to do aoc, but the puzzles are going to be so hard

muted aurora
#

Fair enough

#

My first AoC so I have no idea how it ends up going

sleek cave
#

same!

low condor
#

If this year is like last year, it shouldn't be so bad

sleek cave
#

cough day 20 cough

proud cosmos
#

Yeah last year was very manageable

#

except day 18 and 20

limber needle
proud cosmos
#

hate day 20 gang

muted aurora
#

I really enjoyed today's puzzle tbh I love bit fiddling

proud cosmos
sleek cave
woven sable
low condor
#

Everyone complains about d20 lol

woven sable
proud cosmos
#

hate on day 20 gang

low condor
#

Wasn't even the one I got stuck on that year

sleek cave
muted aurora
#

Parsing can easily be made super tedioua

proud cosmos
#

I struggled hard with day 20

#

It took me many hours

muted aurora
#

But today was like a good mix of once you get the general idea it's not too tedious

proud cosmos
#

Lol

low condor
#

Day 23 Part 2 is the one I struggled with

muted aurora
#

It was more about figuring it out than actually implementing every edge case

proud cosmos
#

I think day 20 took me like 12 hours or smth stupid and I am not sure why cause it honestly isn't that insane

#

It just didn't want to work

#

:(

low condor
#

Day 20 took a while but wasn't that difficult for me

woven sable
#

What was Day 20 in short?

muted aurora
#

Day 20 for 2020? I'm tempted to give it a try now

#

Ah shit wait is that the backtracking grid placement one

#

I've heard about that

low condor
woven sable
#

Oh

muted aurora
#

Yeah lol I'm good

woven sable
#

o_O

proud cosmos
#

Yeah the first message i can find of me struggling was 22:04

#

And I finished day 20 at 5:30

#

Pretty sure that was already hours in though

#

What a mess that was

low condor
#

No one else complains about 2020 D23 P2 - only I got stuck on that one ๐Ÿ˜ญ

#

Needed a hint in the end to progress it

proud cosmos
#

2030

low condor
#

Oof

#

On mobile now that's why

proud cosmos
#

not sure i can relate

#

Seems I still took a while

#

but not that bad

#

(i prob started really late not that weird for me)

#

I wish it had the date you first opened the prompt or smth

#

would be nice

#

oh it was the cups one

#

that one was nice

low condor
#

you can see where I got stuck on lol

proud cosmos
#

24h on day 25

woven sable
#

Oh no, I hope the 24th and 25th aren't hard this year

low condor
#

yeah I refuse to move forward if I'm stuck

proud cosmos
#

This is my true achievement

#

I see

#

I don't

woven sable
#

I don't want to spend my Christmas killing my mind

proud cosmos
low condor
#

usually 25th is easy

proud cosmos
#

Yeah

#

25th is half free half easy

low condor
#

Eric is aware people have other things to do on Xmas Day lol

woven sable
#

I'll probably finish the problems off at 12 AM

#

Honestly idk if it's anyone else but one of my main motivations rn is the role icon

#

to finish AOC

low condor
#

I'd only care if I got a new colour with it as well :3

proud cosmos
#

Role icon is cool

woven sable
#

Oh I wonder if there will be a new color for it, prob not

proud cosmos
#

tho it's temporary

woven sable
#

Yeah true

proud cosmos
#

They might as well it's 1 month

#

Clearly they should've made it a 1 year thing though

#

I kinda hope they leave the role after but just remove the icon/color

#

kinda cool to have

noble skiff
#

re a discussion here, was discussing in another python chat, about the multi part parsing problems/computers/calculators vs other types of problems, and someone else who wasn't crazy about those problems offered this gem

If I wanted confusing requirements and having to worry about my previous solutions I might as well be working lol

humble copper
#

wording is what makes the questions tough

low condor
#

If the requirements were simple then AOC would be too easy

#

I think it would also lose its charm as well

noble skiff
#

i think there's some over-generalizing going on