#advent-of-code

1 messages ยท Page 50 of 1

limber needle
#

yeah i was going through some papers that may have touched on day 19's questions

#

like this one for example

sleek cave
#

i'm diving into the wonderful world of weighted graphs and search algorithms

#

i'm in love with aoc

limber needle
#

things i'll never use in the future grin_dog

low condor
#

You never know - maybe one day you'll have a job as a Travelling Salesman

sleek cave
#

lmao

#

OMG A* IS ABSOLUTELY BRILLIANT

#

HEURISTICS ARE BRILLIANT

#

SEARCH ALGOS ARE BRILLIANT

placid lake
#

lmfao

robust heart
#

when this ends, can we keep some links as reference?

#

Or do we continue in the algos channel?

minor cave
#

This channel will hang around until at least january, but otherwise the algos channel is a good alternative

sleek cave
#

okay, i understand a star in theory

#

implementation is a whole other problem...

proud cosmos
#

Actually really simple if you understand the theory and think about it a bit

#

:)

sleek cave
low condor
#

can't wait to tell you what my solution was for that day ๐Ÿ™‚

sleek cave
#

i'm thinking of 25 nodes, 5 by 5 simulating the risk levels

low condor
#

in the meantime, best of luck ๐Ÿ™‚

sleek cave
#

alright, time to get paper programming

sleek cave
fossil cipher
#

I think I have hit my AoC Wall. Saturday's I think I've finally understood the destructions, just haven't attempted it, yet. Today's is just... wow. I don't even know where to start or how to approach it.

I plan to attempt upcoming puzzles, but my 17-day streak for this year is my best ever, so not too shabby ๐Ÿ™‚

low condor
fossil cipher
#

Well, I'm on leave for the next two weeks, so should have plenty of time to try them. Not giving up, but certainly beyond my skill level (in terms of the maths and algos required). There isn't a big call for 3 dimensional beacon detection with inferior scanners in my day to day use of Python. ๐Ÿ˜„

hybrid schooner
#

||is the score for day 4 part 2 6426? cant check it right now on the website||

low condor
hybrid schooner
#

ah ok thanks so i guess i need to wait ๐Ÿ˜„

sleek cave
#

my brain is subsisting suboptimally

pallid quail
#

For day 4, I'm struggling with processing the input data. Not sure how to approach this. The first line, I've put in a variable called draws, and have split that string into a list on the commas, so now I have a list of draws - which is fine.

But for the boards - I want to iterate through the lines, and make each board a dict, made up of a list for each row....

pallid quail
#

I don't have anything actually of any substance. I couldn't even conceive of how to do it. I've only been learning python for about a month - and I think day 4 is where I am tapping out (for now). I went back to my bootcamp that I am doing to actually learn python - and getting back to that cause I feel like right now I'm being held back because there are still some basics that I am lacking.

abstract bluff
#

you said you managed to parse the first line, show me how you did that. perhaps we could work out how to do the rest?

pallid quail
#

Sure, one sec.

#

Let me re-load the project in vscode

#

this is the function I use to process the input data - I've been using it since the day 1 challenges.


def process_data(filename,datatype='str'):
    with open(filename, 'r') as f:
        if datatype == 'int':
            data = []
            for i in f.read().splitlines():
                data.append(int(i))
            return data
        elif datatype == 'str':
            data = []
            for i in f.read().splitlines():
                data.append(i)
            return data            
#

Then I ingested the data into a variable called "data"

#
data = process_data('d4_input.txt')
abstract bluff
#

okay, so you reading by lines, which is a good first step

pallid quail
#

And took the first line of the data, and put it into a list called "draws" by doing this:


draws = data[0].split(",")

abstract bluff
#

okay thats great

#

now did you make sure to cast that to a list of integers

#

?

pallid quail
#

Its taking the actual boards, and putting them into a workable format.

#

I did not, I was going to make them integers when I called them later

#

by just doing int(draws[someindex])

abstract bluff
#

okay. fair enough

#

so if I gave you only one board would you then know how to parse it?

#
22 13 17 11  0
 8  2 23  4 24
21  9 14 16  7
 6 10  3 18  5
 1 12 20 15 19
pallid quail
#

Heh, hadn't gotten that far yet!

But I digured I would have put it in a list, then put that list in a dict, with each board having a key like 'board1': [[board,rows],[board,rows],[board,rows],[board,rows],[board,rows]]

#

And then, for each draw, going through and checking each board for the draw int

abstract bluff
#

yeah, you got the gist of the idea

pallid quail
#

and thats about as far as I had gotten in terms of figuring out how to deal with it

abstract bluff
#

but focus on parsing a single board first

#

it's kind of like the first line, except you split by a space instead

#

you also know each board will have 5 lines

pallid quail
#

My problem was, I don't know how to write my code to split each 5 lines of a board into a a dict key value, then ignore the blank line, and repeat.

abstract bluff
#

do you know how to use a for loop?

pallid quail
#

Oh yeah, I even wrote a few recursive functions to solve day 1-3

abstract bluff
#
board = []
for line in lines:
  row = line.split(" ")
  board.append(row)
pallid quail
#

Thats what I was sort of starting to write - but how do you handle the blank lines?

#

Would I just write something like


board = []
for line in lines:
  if line == '\n':
    pass
  row = line.split(" ")
  board.append(row)
abstract bluff
#

yes! you're almost there

#

instead of pass, we use continue

pallid quail
#

Ah right

abstract bluff
#

whenever you hit a newline, you know a new board is starting

pallid quail
#

pass is just if I define a function, but don't have anything in it yet...

abstract bluff
#

so append the old board to another array maybe called all_boards

pallid quail
#

Well, I had created an index variable.

#

That I was going to add 1 to, each time a new board is started

#

and use that variable, to add the board to a dict key value

#

calling it f'board{index}'

abstract bluff
#

a dictionary isn't quite useful here, another array will allow you to index boards the same way

#

without you having to manage the index variable

pallid quail
#

So, thats what I also meant by sort of being limited by my limited knowledge of python.

#

I've never used anything like numpy or anything like it - if thats were you're going in terms of using arrays.

abstract bluff
#

no numpy isn't needed at all

pallid quail
#

So when you say array, do you just mean a list

#

or list of lists?

abstract bluff
#

yeah!

#

list

#
all_boards = []
board = []
for line in lines:
  if line == '\n':
    all_boards.append(board)
    board = []
    continue
  row = line.split(" ")
  board.append(row)
#

this is what I was getting at

pallid quail
#

Okay, yeah - that's sort of where I was going with this. But I guess I was overcomplicating it by trying to use dictionaries.

abstract bluff
#

also make sure you ignore the \n after the first line and append the last board after the for loop.

pallid quail
#

So, I actually just looked at my data after ingesting it

abstract bluff
#

since there is no newline at the end of the file

pallid quail
#

I don't have any \n characters

abstract bluff
#

ahh, yeah splitlines() probs removed them for you

pallid quail
#

my ingest function removes those, yeah

abstract bluff
#

just check if len(line) > 0

#

since splitlines() will have a empty string for a empty line

pallid quail
#

Actually, no not seeing that either

abstract bluff
#

what are you seeing then?

pallid quail
#

Here is what is in my 'data' variable after ingesting the text file

#

oh wait, its too big. Gonna throw it into a pastebin

abstract bluff
#

yeah you do have a empty line see line 2 of the pastbin

#

there is a '',

pallid quail
#

Oh, I thought you meant at the end

#

Gotcha.

abstract bluff
#

no every empty line gets converted to a empty string by splitlines()

pallid quail
#

I added:

#
for row in test:
    if index == 0 and row == '':
        continue

#

test is just the sample data from the challenge.

abstract bluff
#

how about index?

pallid quail
#

oops

#

that should be line

#

forgot to edit that line after I removed the index variable

#

err row

#
for row in test:
    if row == '':
        continue
    elif something
#

Oh wait, that won't work now

abstract bluff
#

you want to just check the row itself not the line number

#

since after each bingo board there is a empty string

#

you can look at your data dump again

pallid quail
#

I've got it it up on my other screen

abstract bluff
#

ok now just use the same logic for the board parser you had earlier

pallid quail
#

ok cool - thanks for talking me through it - heh I think I can figure out this part now.

abstract bluff
#

good luck ๐Ÿ™‚

pallid quail
#

thanks!

#

One last question

#

Is it possible to execute certain actions, just on the first run through a for loop somehow?

#

without using enumerate

abstract bluff
#

if you just want the first run, then just do it outside the loop right before it

pallid quail
#

Oh

#

right

#

I wanted to remove the first blank space by popping it out

#

I can do that right before the for loop starts

abstract bluff
#

lines = lines[2:] should work

pallid quail
#

Oh right that would work too

#

Is that more performant than say, pop? A friend of mine who is a professional programmer mentioned something about pop being less than ideal when working with larger data sets.

#

Or maybe I just misunderstood what he was explaining. or rather, when popping stuff off from the start of a list.

abstract bluff
pallid quail
#

on one of my previous solutions, in a recursive function - on each run through I was popping out the item at index 0

maiden brook
#

if you pop a list at the start you have to shift everything one index to the left

pallid quail
#

I was pretty stoked about that - it was my first ever recursive function lol

abstract bluff
#

python uses dynamic arrays for lists i think, so unless you pop() from the end, its O(n)

pallid quail
#

(spoiler for day 1)

#

Gotcha, so for a list with 2000 items, if I pop one from the left, then it has to do 1999 actions, to move everything over to the left by one?

abstract bluff
#

yeah

#

however, given that you seem to be just starting out programming, worrying about complexities of builtin functions shouldn't be on your list of concerns

pallid quail
#

haha - thats what I said to my friend.

abstract bluff
#

undoubtely complexity is important, but not "for you right now"

pallid quail
#

Okay, making progress - but I have another little problem.

#

For numbers that are just 1 digit, there are two spaces

#

So I end up with: ['', '2', '', '0', '12', '', '3', '', '7']

abstract bluff
#

use the same technique as earlier filter the list for elements with length > 0

woven sable
#

You can use split with no arguments to split by any amount of spaces if you're splitting it

#

Unless, that's not what you're doing

#

!e
print("2 3 4".split())

marsh currentBOT
#

@woven sable :white_check_mark: Your eval job has completed with return code 0.

['2', '3', '4']
pallid quail
#

oh ok

abstract bluff
#

^ that works too

pallid quail
#

perf

#
[
  [
    ['22', '13', '17', '11', '0'],
    ['8', '2', '23', '4', '24'],
    ['21', '9', '14', '16', '7'],
    ['6', '10', '3', '18', '5'],
    ['1', '12', '20', '15', '19'],
    ['3', '15', '0', '2', '22'],
    ['9', '18', '13', '17', '5'],
    ['19', '8', '7', '25', '23'],
    ['20', '11', '10', '24', '4'],
    ['14', '21', '16', '12', '6'],
    ['14', '21', '17', '24', '4'],
    ['10', '16', '15', '9', '19'],
    ['18', '8', '23', '26', '20'],
    ['22', '11', '13', '6', '5'],
    ['2', '0', '12', '3', '7']
   ],
   [
    ['22', '13', '17', '11', '0'],
    ['8', '2', '23', '4', '24'],
    ['21', '9', '14', '16', '7'],
    ['6', '10', '3', '18', '5'],
    ['1', '12', '20', '15', '19'],
    ['3', '15', '0', '2', '22'],
    ['9', '18', '13', '17', '5'],
    ['19', '8', '7', '25', '23'],
    ['20', '11', '10', '24', '4'],
    ['14', '21', '16', '12', '6'],
    ['14', '21', '17', '24', '4'],
    ['10', '16', '15', '9', '19'],
    ['18', '8', '23', '26', '20'],
    ['22', '11', '13', '6', '5'],
    ['2', '0', '12', '3', '7']
  ]
]
abstract bluff
#

great! just remember to cast them to integers

pallid quail
#

Actually, not perfect.

#

I ended up with the array above, which is the three sample boards, twice

#

in two lists within the all boards list.

abstract bluff
#

what is your code?

pallid quail
#

draws = test[0].split(",") # takes the draw numbers on the first line, and splits them into a list.
lines = test[2:] # grabs everything after the draws and the first empty line.

all_boards = []
current_board = []
for row in lines:
    if row == '':
        all_boards.append(current_board)
    else:
        row = row.split()
        current_board.append(row)

abstract bluff
#

you forgot to set the current_board to [] after you append it to all boards

pallid quail
#

lol oops

#

@abstract bluff One last quick question - when I put the draw numbers into the draws variable above - is there anyway to convert those to ints as part of that variable assignment?

#

I tried

draws = int(test[0].split(,))
#

but that didn't work.

abstract bluff
#

draws = [int(c) for c in test[0].split(',')]

pallid quail
#

ahhh list comprehensions.

#

Didn't think of that

#

๐Ÿ‘

#

Might write a function for that so I can have it work on any variable name, not just test.

#

Thanks again!

abstract bluff
#

no problem! any question just ping!

pallid quail
#

Thanks, I appreciate it - I was about to give up haha

humble copper
#

well its almost time

#

99.9% chance i wait until tomorrow to start

prisma sundial
#

gl

pallid quail
#

Oh the new challenge heh yeah. Man today's challenge makes me think I'm screwed once I get to it if day 4 was a struggle.

woven sable
#

Don't worry, day 4 was kinda difficult for me too

hidden copperBOT
humble copper
#

which one was that

woven sable
#

and a few others

foggy zealot
#

third

pallid quail
humble copper
#

yeah that was hell

wide garnet
#

:v I lost hope after not being able to solve 3 puzzles around day 16

humble copper
#

after today's challenge ill be 80% of the way there

#

(maybe 81.63% if ||d25p2 is a freebie like 2020||)

pallid quail
#

Does it stay up after the fact - like, if I don't get them all by the 25th can I still attempt them later?

humble copper
#

yep

humble copper
#

if youre doing the leaderboard here and you want the role, both parts of all 25 days need to be completed by january (i think)

pallid quail
#

Naw, I haven't bothered with that.

#

Maybe next year when I've been programming for more than a month

woven sable
#

never had a role icon ever in any server

pallid quail
#

I work at a saas company in client services, and I joined the private leaderboard the software engineering team is using...

#

they've been super encouraging on slack - but I try not to bug them with questions to much - cause its a work slack and they are busy. A noob in client services is probably not something they want to deal with.

woven sable
#

Well, you can always ask here ๐Ÿ˜„

humble copper
#

ig it really depends on what you get experience with

pallid quail
#

I'm hoping that I can get to a point where I can join said software engineering team.

humble copper
#

like it you build discord bots for 10 years you might do extremely well on a discord bot building challenge

#

but who knows on anything else

pallid quail
#

For sure!

#

Anyway - its getting late, going to take a break of staring at vscode and check out halo infinite for a bit. I'm on vacay and my kid is in daycare still so I'll have all day tomorrow to mess around with these challenges.

humble copper
#

it may even help to start keeping a github repo of your aoc solutions

pallid quail
#

Already doing that

humble copper
#

same

pallid quail
prisma sundial
#

damn not quite lb today

pearl moon
#

The infinite size thing for 20... Is that just to give you surrounding values for image positions on the borders of the image?

prisma sundial
#

in every direction the image is infinitely . (with the exception of course of the provided image)

pearl moon
#

But what's the relevance of that information

prisma sundial
#

it basically tells you that when you do these 3x3 things, the image can grow

pearl moon
#

I'm saying it seems like that is just there to give you something to use for valued on the border

prisma sundial
#

oh yeah i think we're saying the same thing

pearl moon
#

Err...isn't the output image the same size as the input?

prisma sundial
#

i mean they're both infinitely large

pearl moon
#

Oh I guess not

prisma sundial
#

in terms of the interesting region, no

pearl moon
#

Looking at examples...I meant the non infinite dot portion

#

Ok so it really means you need to apply it to all the pixels which aren't just dots surrounded by all dots...presumably

#

That would include a few pixels just outside the border of the finite region

woven oriole
#

how is it replicating out of the borders of the initial image

#

each pixel is decided by 9 pixels right , we never iterate over outside the image (only check neighbours), so how did it turn into light pixels ๐Ÿค”

somber crow
woven oriole
#

how are we expected to iterate infinitely lol

#

we should only check the part given in the input

somber crow
#

thats the puzzle

woven oriole
#

mhm

somber crow
#

||think outside the box, || ||do you need to literally have infinite largeness?||

late frigate
#

rip I did ||+1 instead of -1|| and spent 30 mins debugging

brisk briar
winter vigil
#

does anyone have any hints for day 14 part 2?

#

it is kind of like the lantern fish problem

woven solar
pearl moon
candid berry
brisk briar
#

lmao

pearl moon
woven solar
pearl moon
#

Well in that case almost all of the characters will still be changing to the same thing...either way the finite region will be surrounded by infinity of the same character

woven solar
#

that's true, yeah

dense shell
#

Can anyone help me solve max recursion depth reached in my code

earnest forge
#

Well you've almost certainly done something wrong, but if you want a footgun check out sys.setmaxrecursionlimit

earnest forge
#

That seems to be true of all inputs. If you want a more useful test, ||swap the leading . and trailing # of the algorithm for the example. The answer is 24||

candid berry
#

This really needs to be in spoiler tags. It's giving away a non obvious piece of the puzzle.

livid gull
earnest forge
#

Eventually

#

Having something to repeatedly debug against meant I spent less time being timed out

livid gull
#

yeah i normally try the test data for the harder days before my own data, but todays was hard to use

cunning summit
#

hii

robust heart
#

trying to figure out the same

#

Is that a trench?

sonic silo
#

its a trench

wooden jewel
#

does everyone else have ||# for the replacement of 9*.||? It's driving me up the wall

sick crag
#

yup

#

||that and . being the last character||

wooden jewel
#

||Well yeah you'd need that if the first character is '#', otherwise you'd get an infinite answer ;)||

earnest forge
wooden jewel
#

yay

#

Thanks for the test case, that really helped in debugging :)

#

has anyone written an image encoder for this problem yet?

woven oriole
#

is that really an image

jade root
#

aa my solution for day 20 works on example but not on full input :((

frigid mural
#

yall ever find it satisfying when 2 consecutive lines have the same length

wooden jewel
woven oriole
jade root
#

ik

woven oriole
#

||9 dots can result in a # if 0th index is a #||

jade root
#

E

woven oriole
#

||and the # formed can once again be changed to . if the last char of algo is a . lol||

jade root
#

my brain lahfdsjfhasdfa

woven oriole
#

relax

jade root
#

||the image is infinite but 9 .s can form a # so the answer is infinity aaaaa||

frigid mural
woven solar
#

||on step 1, yes. But you're not asked about step 1.||

woven oriole
#

||on step 2 it will again become dots||

jade root
#

omg yay

#

oh no part 2

#

YAY

#

finally ;u;

frigid mural
#

that was a very quick rollercoaster of emotions, omg yay to oh no to YAY in 2mins flat lol

jade root
#

yes lol

#

i was so worried it wouldn't work for part 2

glad tartan
#

the example after 50 enhancements

cosmic herald
#

Which should I use... file.read() or file.readlines() for reading an entire file?

wooden jewel
#

You can just do for line in file and get every line in the file without reading it into memory all at once

cosmic herald
#

Thanks!

frigid mural
#

oh lol i wasnt sure if this S-tier fudge i was pulling would work but it does

brave wren
#

The example runs exactly as expected but the actual input isnt correct :c

glad tartan
#

there is a catch in the input :). what happens to the infinite background after the first enhancement?

brave wren
#

oh god

sleek lark
#

Any tip for day 17 ? Max x speed is pretty easy to calculate but y is a bit tricky.

proud cosmos
#

Consider what happens for a y speed ignoring x

#

Then attempt tofigure out how high y speed could possibly be

sleek lark
woven solar
#

you can use math to make part 1 a one-liner and part2 fairly straightforward, but it's actually also possible to just bruteforce all possible vx and vy values.

proud cosmos
#

Is it really?

#

Think some more

sleek lark
# proud cosmos Think some more

Even at high speed it is very possible for the probe to hit the target, so unless I can only constrain Y with X, please be a little less condescending

proud cosmos
#

I wasn't condescending I was trying to point you to the fact there is in fact an upper limit for y

#

Especially since the example even admits only y=9 works and nothing more in their case

#

I figured out what the max limit is by looking only at y and how it behaves for different y values

#

Guess the tip wasn't clear enough though.

sleek lark
#

But it is only because the exemple is built like this. The input could be not as much constrained.

mossy basin
sleek lark
humble copper
#

doing this suoer early on a second machine which i just remembered doesnt have vscode installed

#

i have to write everything in nano

#

not fun

brave wren
#

todays solution was definitively not my fastest but at least it works

mossy stream
#

That's not the right answer; your answer is too low. Curiously, it's the right answer for someone else; you might be logged in to the wrong account or just unlucky.
that's pretty KEKW

devout tusk
mossy stream
#

oof da heck is day 19

velvet stag
#

the skip day

mossy stream
#

Well I have an idea on how to do this, but I feel like it will take ages to complete

#

why did they make the direction change smh

humble copper
#

im somehow getting the example right but the input wrong
for d20p1

mossy stream
#

I just read the prompt of day 20

sleek cave
#

oh god this is where stuff goes downhill really quick

#

I'm skipping d19 for now, gonna attempt d15 and d20 today

sleek cave
mossy basin
#

i think 19 was more challenging than todays

sleek cave
#

all the days starting from 18 are challenging ๐ŸŽ„

peak dock
#

19 has been the hardest so far imo

sleek cave
#

I don't even want to read the prompt

humble copper
sleek cave
#

some guy said 19 was comparable to sea monster, oh no...

mossy basin
#

it's comparable, but sea monster was a lot more code for me

sleek cave
#

ah, I see

#

for me, I'm already glad I solved 18 lol

wooden jewel
sleek cave
#

after 5.5 hours of intense programming

mossy stream
#

what the fuck is 19

#

like I can't find any solution that would run in less than two hours

sleek cave
#

big oof

mossy basin
#

i think my solution only takes a couple of seconds

mossy stream
#

your solution is just numpy on top of numpy on top of numpy smh

mossy basin
#

yes

wooden jewel
#

as is tradition

sleek cave
#

||I'm learning a* on the spot to solve day 15, I'm not going to learn its implementation, though, since I need to figure that out myself in order to have completed the puzzle lol||

#

I imagine how long it would have taken if that algorithm hadn't been used

mossy basin
#

i'm sure the wiki has pseudo code

sleek cave
#

no pseudocode for me bc I like pain :D

mossy basin
wooden jewel
mossy stream
#

wtf some people have some >2s pure python solutions

woven sable
#

Am I the only one having trouble with Day 20?
||what do you do if there aren't 9 pixels surrounding the current one?||

sleek cave
woven sable
mossy basin
woven sable
peak dock
#

for step 1 yeah

woven sable
#

or rather, replace . with all the ones that aren't there

#

got it

crisp coyote
sleek cave
sleek cave
crisp coyote
#

Yeah I did some learning myself on that one, in my initial solution I just used ||.sort|| lol (||instead of a heap||) but then looked into better ways to do it afterwards

woven oriole
sleek cave
woven sable
#

I wouldn't have used ||heapq|| if I didn't learn about it in a Beazley talk a few days before

sleek cave
woven oriole
sleek cave
#

nice

humble copper
humble copper
#

yep

low condor
#

I'm not going to look back over all the spoilers so maybe this has been said already

#

||but there's a specific trick with the real input that makes it different to the test input in a particular way ||

#

^ this tripped me up as well

humble copper
#

oh

#

yep i see it

woven sable
#

Wait, what is it?

low condor
woven sable
#

Oh not yet

low condor
#

best to attempt it first ๐Ÿ™‚

woven sable
muted aurora
hidden musk
#

<>2

mossy basin
#

โค๏ธ

muted aurora
rapid wolf
#

there are several

low condor
#

isn't it used instead of != ?

rapid wolf
#

pascal and python 2 come to mind

low condor
#

might be wrong on that

rapid wolf
#

oh yeah, !=

hidden musk
#

and in some it's the total comparison op

muted aurora
#

yeah mb

muted aurora
#

that's wild

rapid wolf
#

indeed

low condor
#

Python 2 had all kinds of weird stuff

#

you could use backticks instead of repr() I believe

muted aurora
low condor
#

And then there was input() which by default ran eval() on anything you typed into it

muted aurora
#

yeah I'm aware of the input() and print() stuff, and how decoding/encoding strings changed

low condor
#

My original Python tutor told me that raw_input() was for strings and input() was for ints, which was sort of correct but in a bad way

muted aurora
#

not really sure of what else was really different, I've just been Python3

mossy stream
marsh currentBOT
#

@mossy stream :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 3
002 |     print(True <> False)
003 |                ^^
004 | SyntaxError: invalid syntax
mossy stream
#

aw

muted aurora
#

We need a from __past__ import ...

mossy stream
#
Python 3.8.6 (default, Apr 14 2021, 17:21:16) 
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import barry_as_FLUFL
>>> print(True <> False)
True
#

(it got removed with the PEG parser)

sonic silo
#

<> good

muted aurora
#

still works for me on 3.10?

mossy stream
#

interesting

muted aurora
#

is the PEG one 3.11?

mossy stream
#

should be 3.10

muted aurora
#
Python 3.10.0 (v3.10.0:b494f5935c, Oct  4 2021, 14:59:20) [Clang 12.0.5 (clang-1205.0.22.11)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import barry_as_FLUFL
>>> 3<>4
True
mossy stream
#

!e

import sys
print(sys.version)```
marsh currentBOT
#

@mossy stream :white_check_mark: Your eval job has completed with return code 0.

3.10.1 (main, Dec  8 2021, 04:14:05) [GCC 8.3.0]
mossy stream
#

hmm it works for me too

muted aurora
#

maybe 3.10.0 vs 3.10.1?

mossy stream
#

testing that

muted aurora
#

BTW if you're interested in my <2s solution in Python for day 19 I'll ping you on the spoilers channel

mossy stream
#

haven't finished day 19 just yet

#

:3

muted aurora
#

ah well, ignore me then

mossy stream
#

also

akarys@mojito ~/P/aoc-2021 (main)> PATH="$PYENV_ROOT/versions/3.10.0/bin:$PATH" python
Python 3.10.0 (default, Dec 20 2021, 16:45:22) [GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import barry_as_FLUFL
>>> print(True <> False)
True
#

so I have no idea what causes this

muted aurora
#

turns out it only works on the REPL

woven sable
#

That sounds weird that it would only work on the REPL

#

oh well

muted aurora
woven oriole
low condor
#

Yup yup

#

But the naming is terrible

woven oriole
#

yeah

mossy stream
#

Why did he have to add random rotation to day 19, I swear

wooden jewel
#

like blegh

low condor
#

Oof

proud cosmos
#

it worksโ„ข๏ธ

low condor
#

The worse one I saw

bright haven
woven oriole
#

i myself have found it in a high school book

#

๐Ÿ˜”

low condor
#

Was where there was a library that implemented goto

#

As an actual keyword

proud cosmos
#

Now that's the real programming

#

I hope it also implemented labels

woven oriole
low condor
#

There's also a book on Amazon that, because Python 2 and 3 has different print commands, decides it's better to make their own print library instead and uses that in its examples

#

its hello world example

#-----------------------------------------------------------------------
# stdio.py
#-----------------------------------------------------------------------

import sys

def writeln(x=''):
    """
    Write x and an end-of-line mark to standard output.
    """
    if sys.hexversion < 0x03000000:
        x = unicode(x)
        x = x.encode('utf-8')
    else:
        x = str(x)
    sys.stdout.write(x)
    sys.stdout.write('\n')
    sys.stdout.flush()

#-----------------------------------------------------------------------
# helloworld.py
#-----------------------------------------------------------------------

import stdio

# Write 'Hello, World' to standard output.
stdio.writeln('Hello, World')

#-----------------------------------------------------------------------

# python helloworld.py
# Hello, World
low condor
#

Introduction to Programming in Python: An Interdisciplinary Approach

I need to leave an Amazon critical comment at some point, ward people off this

#

but yeah, throughout the entire book you see stdio.write('blah blah') instead of print('blah blah')

mossy stream
#

I think my rotation maths are alllllll wrong

bright haven
wooden jewel
#

or just teach py3 lmao

low condor
#

The book was released in 2015

steel bear
#

I guess its aimed for C/C++ programmers

wooden jewel
low condor
#

it should have been written in Py3

low condor
steel bear
wooden jewel
#

I learned Python in... 2012-ish? and back then it was "yeah just use py3, but there is an older version around here are some things to watch out for"

#

And I'm pretty sure the website I used was also around pretty long before that

#

(copyright 2010, so yeah)

low condor
bright haven
humble copper
low condor
#

I still rank the goto library as the highest heresy, but this is up there for sure

mossy stream
#

ohmyfuckinggod

#

hmm okay, part 2 shouldn't be too hard

#

I feel bad for copy pasting the code every time

low condor
#

Sometimes I read from input twice cos I can't be bothered to refactor ยฏ_(ใƒ„)_/ยฏ

mossy stream
#

I literally do cp day_19/part_{1,2}.py

#

2.76s, not too bad

#

alright, day 18 and 19 done

#

the aoc is a full day job, I swear

#

let's do 20 and 21 tomorrow

#

hopefully they aren't too bad

#

I have a certain Sally to murder

sonic silo
#

rather

#

it was a global object thing

#

that had lots of overloads for the sake of syntax sugar

#

p funny nonetheless

low condor
#

So, this wasn't the one on pypi

#

This was another where the syntax was goto whatever

#

No parens

#

Can't find it though...

sonic silo
#

the one i was talkin about is in the stdlib

#

iirc

peak dock
#

the what

#

i am quite sure theres never been a goto in the stdlib

low condor
sonic silo
#

bytecode rewrite?

#

where do functions store their bytecode?

#

whats its interface within python itself?

mossy stream
#

that was much easier than I thought

glad tartan
#

!e def func():
import dis
dis.dis(func.code)

func()

marsh currentBOT
#

@glad tartan :warning: Your eval job has completed with return code 0.

[No output]
low condor
glad tartan
#

!e def func():
import dis
dis.dis(func.code)

func()

marsh currentBOT
#

@glad tartan :white_check_mark: Your eval job has completed with return code 0.

001 |   2           0 LOAD_CONST               1 (0)
002 |               2 LOAD_CONST               0 (None)
003 |               4 IMPORT_NAME              0 (dis)
004 |               6 STORE_FAST               0 (dis)
005 | 
006 |   3           8 LOAD_FAST                0 (dis)
007 |              10 LOAD_METHOD              0 (dis)
008 |              12 LOAD_GLOBAL              1 (func)
009 |              14 LOAD_ATTR                2 (__code__)
010 |              16 CALL_METHOD              1
011 |              18 POP_TOP
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/osumutenec.txt?noredirect

restive imp
#

I think I'm starting to lose my mind with this advent calendar ๐Ÿ˜”

restive imp
#

hours of adjusting my code an figuring stuff out, and in the end it still doesn't work

sonic silo
#

oh god

#

why does the bytecode have its own methods

glad tartan
sonic silo
#

nice

glad tartan
#

In 3.11 every code object has a co_qualname attribute (I contributed this feature :))

sonic silo
#

since builtins like sum are written in C that means they mustnt have bytecode ๐Ÿค”

#

oh wait

#

thats not

#

ok yeah i was right

glad tartan
#

!e sum.code

marsh currentBOT
#

@glad tartan :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | AttributeError: 'builtin_function_or_method' object has no attribute '__code__'. Did you mean: '__call__'?
sonic silo
#

yep

glad tartan
#

!e import sys; print(sys.version_info)

marsh currentBOT
#

@glad tartan :warning: Your eval job has completed with return code 0.

[No output]
glad tartan
#

!e import sys; print(sys.version_info)

sonic silo
marsh currentBOT
#

@glad tartan :white_check_mark: Your eval job has completed with return code 0.

sys.version_info(major=3, minor=10, micro=1, releaselevel='final', serial=0)
glad tartan
#

bleeding edge

sonic silo
#

this is like

#

dam

#

i should investigate about this

#

pushes that into the long queue of "things to investigate for later"

glad tartan
sonic silo
#

can i not manipulate it directly?

#

or is this just some nice API over an already existing but lmited API?

glad tartan
#

code objects are immutable, as well as function objects. This package is a nice way of manipulating bytecode by using abstract instructions where you don't have to resolve jump offsets yourself

sonic silo
#

hm

#

does that mean the wrappers and decorators return new functions?

#

which read the original function and make a new one off its bytecode?

sleek cave
#

if this is the right answer

#

okay it's not

humble copper
#

i hate this.

#

||took 5 hours to do, with each attempt at running the program taking 15-20 minutes ||

humble copper
#

||because i dont want to waste time optimizing||

low condor
#

by not wasting time, you end up wasting time ๐Ÿ˜›

bright haven
humble copper
#

i thought i was gonna end up mentioning how i did it, so i spoilered just in case

low condor
#

this is Advent of REDACTED

humble copper
#

should i unspoiler

ruby epoch
#

For day 5, we donโ€™t actually need to draw the board, do we?

bright haven
sleek cave
#

BRUH

#

||30 minutes of debugging only to find i forgot to heapify my priority queue every time i mutate it lmao||

#

programming in a nutshell: stupid mistakes

sonic silo
#

mood

sleek cave
#

||i made a very shitty a* that probably won't solve part 2 of day 15||

#

time to optimize

peak dock
sleek cave
#

oh, it's a hint on optimization

#

sorry, no hints, can't read!!

robust heart
#

There's something I don't understand with day 16

#

How do you define where the subpackets are

#

In the second example ie

#
00111000000000000110111101000101001010010001001000000000
VVVTTTILLLLLLLLLLLLLLLAAAAAAAAAAABBBBBBBBBBBBBBBB
#

I understood that the next subpackets must have a length of 27

#

But how do you define where A stops, where B begins, and if there's a C subpacket

velvet stag
#

from the length

#

or the 0 marker if it's a literal

sleek cave
velvet stag
#

and yeah you don't know in advance

#

you can't just say the packet is from here to here and read that part, no way around it

#

you need to start reading blindly

robust heart
velvet stag
#

uh

#

i don't know what you mean

robust heart
# velvet stag uh

VVVTTTILLLLLLLLLLLLLLLAAAAAAAAAAABBBBBBBBBBBBBBBB I have to try where A extends till it's correct, right?

#

Haven't done many bit manipulations

white elbow
#

I don't quite understand day 20

#

and I have a weird thing that when I comment out the print_image function I made I get a different answer

pallid quail
#

I am on day 4 - (literally been writing pythin for about a month, so its slow going).

I had a quick question. For the win conditions for the bingo boards - right now I am just thinking of writing out a bunch of if statements that check for each index for the various win conditions. Its going to be huge - wondering if there is a better way to approach this.

white elbow
#

you can use for loops

pallid quail
#

But, the loops will still need an if statement for checking each index in a possible "win condition"

white elbow
#

I made 2 loops for horizontal and vertical, and in the loops I said if a == b == c... : return True

#

or whatever your loop variable is named

pallid quail
#

I guess I could make a dict of the various win conditions, then wrote a loop that checks each board for each possible condition...

white elbow
#

and at the end of the function I have a return False

low condor
#

@pallid quail ||I used numpy to let me check the vertical conditions||

glad tartan
#

!e import dis
def decorator(f):
def wrapper(*args, **kwargs):
return f(*args, **kwargs)
return wrapper

dis.dis(decorator)

marsh currentBOT
#

@glad tartan :white_check_mark: Your eval job has completed with return code 0.

001 |   3           0 LOAD_CLOSURE             0 (f)
002 |               2 BUILD_TUPLE              1
003 |               4 LOAD_CONST               1 (<code object wrapper at 0x7fd59d0fe290, file "<string>", line 3>)
004 |               6 LOAD_CONST               2 ('decorator.<locals>.wrapper')
005 |               8 MAKE_FUNCTION            8 (closure)
006 |              10 STORE_FAST               1 (wrapper)
007 | 
008 |   5          12 LOAD_FAST                1 (wrapper)
009 |              14 RETURN_VALUE
010 | 
011 | Disassembly of <code object wrapper at 0x7fd59d0fe290, file "<string>", line 3>:
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/evoqozehax.txt?noredirect

glad tartan
#

see the MAKE_FUNCTION call there

sleek cave
woven sable
violet raft
#

for the transparent oragami, is it by chance that the chosen x and y was just perfectly half of the paper?

#

or could it be like folding at x = 8

#

when the length of the paper is 10

woven solar
#

it can be

noble skiff
#

someone told me it was always at the halfway point, but I never tried to verify that or took that into account in my coding

violet raft
#

ok, thx

placid lake
#

itโ€™s always at the half point, yeah

humble copper
#

historically, have days 21-25 been easier than 16-20?

#

or are they the hardest ones

woven sable
#

actually, i'm going to test this out into actual statistics!

sleek cave
#

ugh another bruh moment day

#

my thought process is clouded by a thick substance of confusion

#

can't even implement ||a*|| ๐Ÿ˜”

woven sable
#

google sheets doesn't let me label the years but here's all AOC years ever and how many % of pepole have completed themv ersus at the beginning:

woven sable
woven sable
#

yeah, I wonder what year that was

#

also fyi @humble copper ,here's a chat of the average amount of people who complete deach day from day 16 through 25 in all years

pallid quail
#

I was just dealing with a dictionary for all of my rows and triggering a win if all cells in a row are marked, or when considering all rows of all cells at a specific index position are marked.

#

Made for some convoluted logic.

low condor
#

@sleek cavewhat day are you on?

sleek cave
#

||my a star algo is so badly implemented||

#

but nonetheless, after literally spending 20 minutes on how to expand the input by 5 in both dimensions (you can thus get an idea of how confused my brain is today, to be fumbling on such a simple part of the problem), i'm running the solution

#

i expect the solution to be calculated in about an hour

#

so it's just patience from here lmao

low condor
#

hey, as long as you get the solution, who cares, right? ๐Ÿ™‚

#

just as long as it completes in an hour and not 500 years, that's totally fine ๐Ÿ˜›

sleek cave
#

idk why, sometimes i see a puzzle and i go "hey, i can definitely solve that" then that mindset starts yeeting me off into the grand canyon of confusion and despair (exaggerated, but it's kinda like this)

pliant comet
low condor
sleek cave
#

that's what i mean by unrealistic - i'm eventually going to not figure out the answer at one of the puzzles (because eventually there'll be one that exceeds my capabilities), but i'm still irritated when that happens

low condor
#

also, if a puzzle does defeat you, and it happens to the best of us, the best thing to do is accept it and see how it should be done

#

that way you learn from it

#

I had to do that with 2019 day 18 this year, no matter what I tried I just couldn't do it

violet raft
#

i don't understand what counts as a dot for day 13

#

are these like dots that are being folded onto another dot?

#

or a # thats being folded onto a dot, so it's visible on the back side of the paper

#

or is it a dot that's replacing a #

low condor
#

||if a # folds onto a ., that leaves a #||

#

||if a # folds onto a #, then there's still a # there. And the same with . .||

violet raft
#

ok, so am i counting how many times ||"if a # folds onto a ., that leaves a #"|| this happens for part 1?

low condor
#

||you're counting how many # are left with one fold||

violet raft
#

oh, wow

#

i got confused lol

#

i forgot # were "dots"

#

and thought "." were dots

low condor
#

easy mistake lol

low condor
#

'.' are literally dots ๐Ÿ™‚

sinful pawn
#

well... technically... they're "periods"

#

โ€ข, though, is a dot

low condor
#

which, as a British-man, I approve of rather than period ๐Ÿ™‚

sleek cave
#

\s

woven solar
#

since it's plausible that every task removes x% of the playerbase

woven sable
#

Dumb question, but what's an exponential fit?

woven solar
#

Fitting an exponential curve a*e^(b x) instead of line

#

it can be done, say, by doing a linear fit on x, log(y) - if you get a,b such that log(y) ~= a+b*x, then y ~= e^a * e^(b*x).

woven sable
#

Ah

woven solar
#

here, you could fix a=0 since day0 is always 100% and only fit b

sleek cave
#

me brain has now recharged after today's defeat on day 15. I'll reattempt that day when I have time. looking forward to day 21!

hidden copperBOT
sinful pawn
#

oops

stable heron
#

interesting

#

but ive just given up

crystal shard
#

Heh

stable heron
#

but hey this isnt that hard...

crystal shard
stable heron
#

lmao

humble copper
#

this seems easy

potent pumice
crystal shard
potent pumice
#

not you specifically, i mean the screenshot you took

crystal shard
#

Oh, people solved it already

#

only 27

potent pumice
#

now 51

#

57

#

68

woven solar
#

wtf do you mean

#

the lb filled in 20:44

potent pumice
humble copper
#

interesting part 2

#

...and i have no idea what im doing

humble copper
#

||i wrote down the different rolls that could happen, im assuming this has something to do with how to solve pt2?||

pearl moon
#

On day 21....will a brute force solution work for part 2? I glance at part 1 and see it's easily brute forced but also sense there should be a closed form solution. I just don't know how to easily work that out

woven solar
#

||no, for part2 it won't||

#

though ||part2 is very different from part1 for day21||, so it's okay to use a straightforward solution for part1

onyx plank
#

ok so part 2 is getting out of fucking hand lmao

#

part 2 be like "but what if it were 5D Chess With Multiverse Time Travel?"

woven solar
#

part 3: players can now choose to instead go back in time to an earlier state

pearl moon
#

Ahh ok. I'm just afraid of writing out a brute force solution for part 1 which would be a waste of time...like when if you just write an optimized solution for 1, 2 is cake

cosmic herald
#

I'm confused with the Day 5 puzzle

cosmic herald
#

Am I missing something?

woven solar
#

it's not shown at all, as you ignore these in part1

cosmic herald
#

I've spent longer than I'd like to admit on this one

#

Thanks

mossy stream
#

What's the catch for today, hmmm

#

It seems a bit too easy

sonic silo
#

part 2 is funky

candid berry
#

it's the easiest one in a while, though

muted aurora
candid berry
#

Hm. Well, I found today's easier

bright spindle
#

I had about the same amount of trouble with yesterday's and today's, though today it was mostly because I misunderstood the part 2 description.

#

Yesterday it took me a while to understand the "trick"

candid berry
#

Took me over an hour to finish both parts of yesterday's, took me 20 minutes to finish both parts of today's

bright spindle
#

I figured out a workable solution to both parts very quickly, but I misunderstood a requirement for part 2 so I got stuck debugging for like an hour before I spotted it

#

||For some reason I didn't grok that you had to add up three rolls for part 2 as well. But once I got it, it was easy to adapt my solution to it.||

quick glacier
#

In today's part 2, do you still throw the die three times on a turn?

bright spindle
quick glacier
bright spindle
#

Heh

quick glacier
#

How do I make spoilers, btw?

bright spindle
#

|| like this ||

bright haven
quasi fjord
#

||hm didnt know of this mehtod, knew of || this || tho||

bright spindle
proud cosmos
#

I wonder why my numbers are so low :(

#

More xamples pls.

#

What a mess to debut

#

Actually just not sure what could be wrong lol

#

I guess I can go through everything one by one till I see anything wrong, sounds a bit questionable though

#

Mayr I'll just go do the obvious solution method instead should be a lot easier

sleek cave
#

drop from p1 to p2 today, interesting

#

if it's exponential growth again I will cry

proud cosmos
#

:)

sleek cave
#

part 1 seems too deceptively easy

bright spindle
sleek cave
#

okay, I need a minor spoiler: is today's part 2 harder because you need an efficient solution or it's something else
because if it's the former I might do day 20 first

bright spindle
sleek cave
bright spindle
#

||I had to write a new solution from scratch||

sleek cave
#

I struggled so hard with day 15 yesterday, couldn't figure out how to implement an efficient algorithm

bright spindle
sleek cave
#

so I was hoping today isn't an algorithm puzzle

sleek cave
bright spindle
#

||But I don't think it's super hard to figure out either||

sleek cave
#

alright, thanks!

humble copper
#

||recursion|| cant be too bad of an idea for this, right?

#

as long as ||i remember to multiply for the number of times a specific final roll can occur||

simple sorrel
#

wasup everybody

#

??

bright spindle
simple sorrel
#

hello?

humble copper
woven oriole
#

||Cache||

proud cosmos
#

The other way is just so easy

#

Still haven't figured out what's wrong

sonic silo
#

||p sure the vast majority of people went with a recursive||

bright spindle
sonic silo
bright spindle
proud cosmos
#

Hmm

#

I'll look at it later in curious if it's similar to min, doubt

bright spindle
#

It's a shame that it's slow because I thought it felt neat.

humble copper
#

||my recursive solution is really slow, which doesnt exactly make sense||

proud cosmos
#

It should be pretty fast

bright spindle
#

||I mean, does it finish, even if it's slow?||

humble copper
#

||appears to be stuck on the first step||

bright spindle
#

Oh, ok

humble copper
#

||its going, but really slowly||

#

||to be fair, that could be because i have probably the worst cpu known to man||

glad tartan
muted aurora
bright spindle
sonic silo
#

p sure that

glad tartan
# bright spindle Yeah

I'd try spawning just the ||7 possible branches and use their weight to cut down on the possible different universes||

sonic silo
#

||hes just not doing memoization||

#

which is why its taking so long

glad tartan
bright spindle
muted aurora
muted aurora
#

||using spoilers is fun||

sonic silo
#

||maybe||

bright spindle
humble copper
bright spindle
muted aurora
glad tartan
sonic silo
#

have you tried doing profiling?

bright spindle
#

Maybe I'll polish it later, but my parents are coming to stay tomorrow and I've got shit to do before then

#

AoC is very fun, but it's kind of naturally at the worst possible time in terms of having free time

somber yacht
#

why everyone talking in spoilers?

bright spindle
#

If you celebrate Christmas, that is.

bright spindle
somber yacht
#

Oh ok lol

#

isn't this for non spoiler things tho?

bright spindle
#

It's not a big deal to talk about spoilers here if you spoilertag them, but if you want to discuss full solutions it's just more convenient to to do it in #advent-of-code-spoilers-archive

muted aurora
#

It's very easy on the spoilers channel to have stuff spoiled for you even if you just want a different completely unrelated question answered, so I use spoilers on here to answer specific questions people have usually

bright spindle
#

Yeah, that's true.

hollow wharf
#

waaat, my day 20 input starts with a true

#

which mean my result is infinity since any pixel outside that gets enhanced will flip to lit?

#

wtf

humble copper
hollow wharf
#

the prompt literally doesn't say anything on how to solve this

#

oh, hmm

#

but like

#

whyyy

sleek shuttle
#

hi

#

what's advent of code i've never done it before

rapid wolf
#

you get a puzzle every day of december up to the 25th

woven oriole
humble copper
#

currently fighting for its life right now because of today's part 2

#

hovering somewhere around 7000-7300 mb

rapid wolf
#

I do wonder if that will finish

humble copper
#

it didnt

hollow wharf
#

the fuck is that prompt

#

time to do maths ig

#

ooooorrrr

#

hmm

#

I am finding interesting results

#

I hardly see how such big numbers can be achived

frigid mural
fossil cipher
#

random thought of the day... have bugs been found in people's inputs in AoC? I imagine every generated input is run through a solution to check it works... but nothing is perfect.

I can imagine it's extremely frustrating if your result is correct, but expected answer is wrong ๐Ÿ˜„

rapid wolf
#

I assume there are enough testers that someone would spot the error

sleek cave
#

oh god major drop from part 1 to part 2

bright haven
sonic silo
#

wait

#

yeah

#

year 2020 day 23 did have some bugs iirc

hollow wharf
frigid mural
#

F

#

my solution uses a pretty quick fix for it, idk whether itll be hard to implement for urs

#

||just have a default value for unseen coords and have it alternate between days||

hollow wharf
#

Yeah that's what I did

crisp coyote
#

I didn't realise that special case but somehow my solution worked anyway lol

hollow wharf
#

Does your input not start with a #?

sleek cave
#

same here

#

okay why is every puzzle's part 2 just severe optimization now, leave my naive inefficient algo alone ๐Ÿ˜”

#

d20p2 requires optimization once again

#

time to do math

frigid mural
crisp coyote
pliant comet
hollow wharf
#

Damn

rapid wolf
#

I was trying to come up with a clever way to do it with sets

frigid mural
pliant comet
#

oop sorry

clear nimbus
#

for you what was the hardest day until today in 2021 AOC?

sleek cave
#

sigh saw the spoiler

sleek cave
fossil cipher
minor cave
#

According to the stats, def day 19

peak dock
clear nimbus
#

do you think this year has been more difficult that the others?

crisp coyote
low condor
fossil cipher
#

This has been my best year. But I think the hardest so far. Iโ€™ve only done so well due to motivation from you lot ๐Ÿ˜„

hollow wharf
sinful pawn
#

this channel has slowly evolved into spoiler heaven

#

I am so tempted to click them all

clear nimbus
#

i'm about 1 week behind because of school, can anyone explain if in day 15 you can walk backwards or only upwards and to the left?

peak dock
#

Can walk in all 4 directions

crisp coyote
#

I've done 20 but am still stuck on 18 for some reason. I've written 150 lines of unit tests and still can't work out what's wrong ๐Ÿฅฒ

peak dock
#

Rip

clear nimbus
hollow wharf
fossil cipher
#

18 and 19 are dead to me. ducky_drawing

hollow wharf
#

That was the problem for us

frigid mural
sonic silo
#

i wanna eventually do project euler tasks

#

they nice

clear nimbus
#

yeah, but unfortunately it worked with all the inputs including sample, except for the last one

#

because it just not correct since you can move in more than 2 directions

crisp coyote
clear nimbus
#

there could potentially be a case where going aroung and passing through like 3 "ones" is better than through 1 "nine"

humble copper
#

i think ill just go sleep now

muted aurora
sonic silo
#

hm

#

i end up writting everything from sctach anyways

crisp coyote
humble copper
sonic silo
#

i think the only thing i would want is a hashable vector

muted aurora
sonic silo
#

2d to 4d vector

sonic silo
#

but still

#

just 2d, 3d and 4d vectors

#

hashable vectors that is

sonic silo
#

some op overloads and thats it

muted aurora
#

I mean I'd just overload a tuple and redefine the +- etc operations

sonic silo
#

๐Ÿค”

#

right, you can just inherit a tuple and redefine ops

muted aurora
#

ye, inherit is the word

sonic silo
#

but still

#

thats still making vectors lmao

muted aurora
#

yeah yeah

#

would be super convenient I agree

rapid wolf
#

julia I have found treats vectors in sets properly

sonic silo
#

thats it tho, i dont even use my parsing functions

muted aurora
#

i wrote a helper to parse a grid for me

sonic silo
#

yeah, same

muted aurora
#

got to use it a surprising number of times so far

sonic silo
#

i DID use intmatrix which is just a parser for converting a 2d grid of single digit numbers into a numpy array

#

and i do have ONE single snippet

#

made exactly for writting a variable called "data" that's assigned to an empty multiline string

#
data = """\
| <- cursor, copy data here
"""
#

this way i can just.. well. paste any samples from the exercise directly

sleek cave
humble copper
#

next year im not making it this difficult for me

violet raft
#

could someone give me a hint on day 14 part 2

sleek cave
# violet raft could someone give me a hint on day 14 part 2

hint on general approach: ||try using recursion, working your way backwards until the problem is reduced to a bunch of base cases. at least this is how i solved it||
hint 2 (more specific, might not want to look at it now): ||the base cases said above are searching polymers and polymer substrings in the original template||

violet raft
sleek cave
frigid zephyr
#

I just finished day 18 (snailfish) feeling like a ||DFS|| god, and now I see day 19... what on earth

rapid wolf
#

day 19 is hard

muted aurora
#

19 was something else

rapid wolf
#

it gets easier after that

muted aurora
#

20 and 21 have been pretty jokes tbh, just some ||annoying tricks to look out for||

rapid wolf
#

yeah, I think my favourite were the snailfish thus far

#

a tough problem with multiple approaches, each with its own pros and cons

#

but none of them were dead ends

frigid zephyr
#

snailfish was quite fun tbh

muted aurora
#

yeah i did it both the popular ones, one was hell

low condor
#

I found d18 easier than p2 today, but yeah, d19 hardest for sure

frigid zephyr
#

I might leave d19 and come back to it later

muted aurora
#

I think it was implementation vs problem solving difficulty, day 18 I knew what to do, was just annoying to implement

#

today I spent a lot of time for p2 just thinking about approaches

frigid zephyr
low condor
muted aurora
#

The two most common were, generally speaking ||using a recursive structure such as a Tree, or just parsing it as a flat list/tokens||

frigid zephyr
robust heart
#

I'll never get this done by the time Christmas strikes

#

But at least i'm halfway done

#

Way better than my previous attempts

humble copper
#

if you don't feel like completing all of them in a short time then you dont have to

hollow wharf
#

so I heard we caught up to the AoC

#

that's cool

robust heart
hollow wharf
#

all of them? in one day?

humble copper
#

just a few days to go

#

(and on top of that, without using any imports at all, even standard library imports. i've come to the realization that maybe i hate myself)

low condor
#

Python is meant to come with "batteries included" but you've removed the batteries ๐Ÿ˜›

rapid wolf
#

do everything using just lists and ints ๐Ÿ™‚

humble copper
#

days 18 and 19 were fine honestly

woven sable
#

I found Day 20 and 21 quite hard tbh

humble copper
#

16 was torture

rapid wolf
#

16 was pretty straightforward for me, but I also have quite a bit of experience writing parsers

low condor
#

I liked 16 a lot

#

I tend to enjoy parser-style questions

rapid wolf
#

same

humble copper
low condor
#

the ones I tend to struggle with are the ||part 2 here's something with huge numbers || type questions

low condor
minor pike
#

work has been busy so I'm very behind

#

still stuck on day 3 part 2 ;(

#

part 1 came easy, idk why part 2 is so hard for me

rapid wolf
#

yeah, I like the this is a pretty hard to implement thing kind of problems, like snailfish, more than the ||optimize thing|| like CO2 scrubbers

low condor
rapid wolf
#

still need figure out a recursion scheme for snailfish.

low condor
humble copper
#

this isnt really easy to define but i really like the problems where i can make... unusual... solutions

low condor