#advent-of-code

1 messages Β· Page 47 of 1

pale heath
#

Im writing my code froms scratch 3rd time

#

Im giving up

low condor
#

Yeah, probably it's not nice for people to say it's easy if others are struggling with it - I'm a bit guilty of that...

pale heath
#

no Im not mad for anyone

#

except myself

#

I feel mad and sad

#

I cant do it

low condor
#

No need to be mad or sad over anything 😦

pale heath
#

I thought Ill be able to finish calendar

#

but I lost

low condor
#

AOC is all about learning

#

If you keep on learning, that's the most important thing

sharp panther
#

What parts are you having trouble with? We may be able to give some hints in the right direction.

pale heath
#

every

#

I tried doing anything but everything is going on how it should

pale heath
#

too many 0s, or something is not added correctly

woven sable
low condor
#

I'd also recommend, if you aren't doing so already, checking with the test input

#

That way you can compare and debug

pale heath
#

ok

pale heath
#

smaller one works

#

but larger not

low condor
#

I did have that as well

pale heath
low condor
#

Turns out I did not read the question properly πŸ™‚

sleek cave
# pale heath I cant do it

same. i'm really struggling today and i think it could be just a bad day
you didn't lose aoc. you persevered, that's all that matters :) try again tomorrow, i'm sure you can get it!

fossil cipher
#

Have a sleep and try again. I left mine for a few hours and came back and found it easier going. Sometimes you just get hung up on something silly, then you noodle your brain and, yeah. Take a break from it for a while πŸ˜„

rancid creek
# pale heath I cant do it

Your code is almost there, I posted in the spoilers channel what you need to change. Message me if you need more.

#

As a general lesson for everyone: it was because of a mutable global variable. πŸ™‚ Avoid using global variables.

hollow wharf
#

just got fucked up by a final urgh

#

will see if I can summon the energy to do today's

#

couldn't yesterday

rancid creek
#

Today's will likely be harder.

hollow wharf
#

I might not do anything. I'm so tired

rancid creek
velvet stag
#

fitty fye minutes folks

winter vigil
#

Yo, how were the past two days?

#

I had to study for my comp sci final

#

So I didn't have a chance to see

#

Ah lol

tight dune
north silo
#

.aoc countdown

hidden copperBOT
#

Day 12 starts <t:1639285200:R>.

tight dune
#

πŸ‘€

woven oriole
#

πŸ›

somber crow
#

1 min

woven oriole
#

.aoc countdown

hidden copperBOT
#

Day 12 starts <t:1639285200:R>.

north silo
#

Good luck everyone!

woven oriole
#

good luck

prisma sundial
#

gl

woven sable
#

Ooo

#

3, 2, 1

#

No i timed that wrong

hidden copperBOT
tight dune
#

letsgoooo

woven sable
#

oh god

#

||pathfinding?||

tight dune
#

UGH

signal grotto
#

ew nope

tight dune
#

fk

north silo
#

Guys no spoilers in this channel.

tight dune
#

deleted

crystal shard
#

there is a whole ass wiki about it, crap

signal grotto
#

Well 17 stars this year for me 🀣, not too bad

crystal shard
left path
#

no time to work on this tonight, dustin and charles are fighting (and amanda nunes lost wtf)

muted pivot
#

There's always a bigger Crab

signal grotto
#

I'm definitely still gonna keep seeing if I understand how to solve the problems, but this might be where things start to slow down for me lol

crystal shard
tidal beacon
#

With your submarine's subterranean subsystems subsisting suboptimally
I got a stroke

ivory ravine
#

ezpz

tidal beacon
#

damn today seems hard

stable heron
#

kinda is 😭

onyx plank
#

oh lordy pathfinding.......

#

time to go research it on youtube LMAO

stable heron
#

Can the sub move backwards?

hollow wharf
#

yes, note the very first example start,A,b,A,c,A,end travels from A to b back to A

patent falcon
#

oh, this started again?

hollow wharf
#

happens every day (48mins ago on the hour) until christmas ducky_party

stable heron
#

😭

#

wont that just create loops?

#

ooh right you cant visit the small caves more than once

#

hmmmmmm

humble copper
#

πŸ‘

#

||not as bad as i thought it was going to be, probably because i got the pathfinding function done as early as i did||

late frigate
#

im starting to see a trend here I dont like

#

I gotta brush up on my graph theory

humble copper
#

is there any way to link my github to my aoc account

sonic silo
#

i make too many off-by-one mistakes

#

and sometimes i Dont

stable heron
hollow wharf
tidal mist
#

think i'm getting better ☺️

stable heron
#

wow you got it in 20 minutes...

#

its been 1.5 hrs rn and ive still not gotten it lmao

tidal mist
#

tbf i closed discord while solving it.

void ocean
#

oh my god i was right

tight dune
#

u were πŸ˜”

split niche
#

oh no

stable heron
#

YEAAAAAAAAAAAHHHH

stable heron
velvet stag
#

the microsoft of SAP

hazy pendant
#

damnit, work to do

gloomy kernel
#

Why that

#

I suck at those

#

Path finding algorithms

gloomy kernel
jade root
#

i really freaked out when i first saw what the problem was

stable heron
#

o-o

#

i stil

#

havent

#

done

#

p2

#

i thought i was gonna get muted there for a sec- πŸ‘€

#

FINALLY

#

DONE

#

😭

tight dune
#

i hv class so cant answer rn :(

#

and i have an exam today
so i dont think ill be answering today

hollow wharf
#

I have two different terminal emulators which render the same character in the same font differently

#

wtf.jpg

sonic silo
#

the only terminal thats ever convinced me is luke smith's patch for st. and xfce4's. altho xfce4's got some problems on its own

restive imp
#

3 hours and still nowhere near a solution 😦

hollow wharf
sinful pawn
#

oh I love Alacritty

hollow wharf
#

I like it because I like what st does and I hate suckless.

hollow wharf
#

it's a sweet setup

sinful pawn
#

is DE supposed to mean something other than desktop environment

#

idk if it makes sense to use it here πŸ‘€

sonic silo
#

id say it makes sense here cause its

#

well

#

his desktop enviroment in the sense that hes got several pieces of software going for daily use

#

rather than a whole package

hollow wharf
sonic silo
#

thats monolithic

hollow wharf
#

that's how I've always heard people talk about it. Just XMonad would be a WM, and a WM plus other bits of software makes a DE

#

that's my understanding at any rate

#

including neovim in that probably isn't right but whatever

sonic silo
#

that is what a DE is

sinful pawn
#

um... I don't think you can consider that a DE

#

we've got like.... desktop environment... and the environment of your desktop

hollow wharf
#

i mean if it's more comfortable I can just call it "the software I use that makes up my main environment" or something

#

but like

sinful pawn
hollow wharf
#

that seems silly

hollow wharf
sinful pawn
hollow wharf
#

okay

#

well at any rate I was understood eventuallyy

sinful pawn
#

indeed

eternal berry
#

Hey, does anybody have some test cases for day 5 solution two? I've tried three test cases and they all look good, but when I use my puzzle input, my answer is too low.

sleek lark
#

I feel like today is the biggest step in teem of difficulty

fluid pebble
#

hi

#

who pinged me

bright spindle
#

It pings you when a new puzzle is published.

fluid pebble
#

ah ok

hollow wharf
#

hi

hazy pendant
#

i got two stars on day 12 yay

#

i got distracted by important stuff

pallid shoal
balmy dome
hazy pendant
loud yew
sinful pawn
#

a lot of things like pkcon break because of it

#

and the scrollback buffer thing is trippy as heck

loud yew
loud yew
sinful pawn
loud yew
#

(that are good for terminal graphics stuff i mean)

loud yew
sinful pawn
#

I use Alacritty even on Windows lol

wooden jewel
sinful pawn
#

it's a kwin thing, more specifically

loud yew
jade root
#

is it just me or is the website down

sleek cave
#

nice alliteration Eric

#

very nice

hollow wharf
#

err, how does it work when your input loops back to the start

pliant comet
#

it doesn't, start is lowercase so you can't visit it twice

hollow wharf
#

can I basically consider this path as null as start is lowercase and it is always getting visited?

#

righto

pallid shoal
hollow wharf
#

hmm for part 2 I am getting 54 on the sample input and I'm not sure why

peak dock
#

i got 56 initially before i fixed it

hollow wharf
#

ah

#

reading is hard

hollow wharf
#

Yo whats this πŸ’€

woven oriole
#

thats what i am debugging

#

πŸ₯΄

#

implementing bonus on recursion is a bit tedious

hollow wharf
#

tip: ||re-read the prompt word per word||

#

||it isn't a code bug||

woven oriole
#

πŸ‘€

#

actually i found where it fails

#

hm

#

the problem is to assign a exclusive bonus cave
and change it as soon as we are done with one path
all
in
recursion
smh

peak dock
low condor
#

Just finished Day 12 πŸ™‚

sleek cave
low condor
tight merlin
#

Hhi

sleek cave
#

hold up- don't tell me i struggled two hours because the order of my code is wrong

#

something ain't right, i'm getting close

sleek cave
#

broke: rich pretty girl
woke: rich pretty print
lmao i just realized how weird and out of context some programming words are

woven oriole
#

i am at the point of google search that if i just google "bruh" it will show

sleek cave
#

omg day 11 is so clear for me now wtf

#

i was just having a bad day yesterday lol

#

on to part 2!

low condor
#

Sleeping on a problem that you are stuck on is often very useful

sleek cave
#

the eureka moment is so amazing

#

on to day 12!!!

low condor
#

So many times at work I went home frustrated that I couldn't solve something, and then waking up the next day the solution is so clear

#

It's crazy, like "why couldn't I see this before"

woven oriole
#

sometimes i just wake up with the answer ready idk how lmfao

sleek cave
woven oriole
#

mentality is a thing

#

it really puts a huge impact on "are you going to do it" ngl

sleek cave
#

very crappy nested solution currently, though, but given the newfound clarity of the puzzle i have today, i will refine it later

sleek cave
woven oriole
#

:D

sleek cave
#

oh god, my solution has flag checking and redundant incrementing and everything lol

#

i'll do d12 first then come back and refine

low condor
woven oriole
#

cya all tomorrow then , lemon_sleepy

#

gn

sleek cave
# low condor You'll like d12 - ||you can do it recursively||

i will like the challenge, but i will hate the mindfk
recursion is always a love-hate relationship for me, i love trying to wrap my brain around weird things but i also hate the suffering that ensues (but then i also love the success after suffering lmao)

peak dock
#

to love recursion you need to hate it first and to hate it you need to love it first

low condor
#

For me recursion is mostly hate but I will use it when it makes sense

#

Kinda like regex

peak dock
#

whomst hath mentioned this unholy word

sleek cave
#

"to love recursion you need to hate it first and to hate it you need to love it first" - hsp, 2021

#

amazingly said

sonic silo
#

i ended up finding recursion a neutral thing

sleek cave
#

With your submarine's subterranean subsystems subsisting suboptimally the puzzle starts with amazing poetry

sonic silo
#

this is the result of me reaching the base case of my recursive love-hate relationship with recursion

sleek cave
low condor
#

It should. Might be a specific piece of it

#

submarine's subterranean subsystems subsisting suboptimally - hover over this piece

sleek cave
#

ah yes

#

just had to hover long enough lmao

low condor
#

yup

#

each day has one

sleek cave
#

wut.

#

I LOVE AOC WHAT,

#

THERE'S EASTER EGGS

low condor
#

Yup lol

sonic silo
#

yes

low condor
#

Day 4 Giant Squid has my fave so far

sleek cave
#

omg

low condor
#

if you find the Star Wars ref

sonic silo
#

unless

#

youve ||enabled that manually||

low condor
#

||no it works without 50 stars - 50 stars just shows where they are||

sonic silo
#

πŸ€”

#

i tried tho

low condor
#

it definitely works

sonic silo
#

:(

sleek cave
#

THIS IS AMAZING

low condor
#

yup yup

sleek cave
#

THE ATTENTION TO DETAIL

#

orz i bow down to eric

#

masterpiece

low condor
#

I knew there was going to be an easter egg there the first moment I read that XD

sleek cave
#

okay i should probably spoiler the image

low condor
#

definitely lol

sleek cave
peak dock
sleek cave
#

that is not a man; rather, a legend.

woven oriole
#

man deserves dedicated server to handle req πŸ›

queen python
#

Looking for small hint to day12 part 1 😰 is this some sort of tree traversal?

sleek cave
#

my brain dies

#

why python why

#

this would otherwise be so elegant

narrow crown
#

im still so behind lol

#

tryna catch up now

eternal berry
#

hi all, i'm having some troubles with day 5. i've posted my solution in spoilers if anybody has any tips on where I may be going wrong

sleek cave
woven sable
sleek cave
woven sable
#

it's confusing but I suppose it has to be that way because of how they're evaluated

sleek cave
#

omg so all the things i did before i could've used chaining for clauses

#

time to refactor

#

another reason to love aoc: revised comprehension knowledge

fringe temple
peak dock
#

also you can chain ifs, [x for x in y if cond1 if cond2]

woven sable
peak dock
#

me too

sleek cave
peak dock
#

mm

fringe temple
#

no i meant how you have both "for line in raw_data" and "for cave in line.split(..." in there

sleek cave
# woven sable TIL

you can read up on comprehensions' syntax in the pyref, i read it months ago but i forgot all about it lmao

#

it has everything on for and if clauses

#

and chaining

#

and formal definitions

woven sable
#

ahh, I should read it sometime tbh

woven sable
#

Thanks!

sleek cave
#

no probs

queen python
#

Puzzle is unlocked. I hate AoC. It works. I love AoC. Sleep. Repeat. :)

sleek cave
#

recursion breaks my brain

#

i can attempt no further

#

i shall try again in some time

noble skiff
#

gah

#

instructions too subtle

#

I missed the "single small cave may be visited more than once"

#

got part a) first try, then b) is giving me grief, so then i spend more time debugging printing out the actual paths than I spent coding the part a) answer, until I found a path that my algo found that wasn't in the toy data solution lol

rancid creek
sleek cave
noble skiff
#

Honestly recursion to iteration awkwardness is pretty bounded

#

You just use an explicit stack instead of the implicit call stack

#

Going the other way can be pretty awkward though for me

low condor
noble skiff
#

Works great till you have an explicit queue lol

#

I don't know offhand how to write BFS recursively

hidden musk
#

just pop from the bottom of the call stack πŸ₯΄

noble skiff
#

Lol

cold ferry
#

i think you might be able to use an iteratively deepening depth first search to get the elements you're looking for in the bfs order?
not sure i'm picturing it right

#

oh i should have just looked it up
https://en.wikipedia.org/wiki/Iterative_deepening_depth-first_search

IDDFS is optimal like breadth-first search, but uses much less memory; at each iteration, it visits the nodes in the search tree in the same order as depth-first search, but the cumulative order in which nodes are first visited is effectively breadth-first

noble skiff
#

It seems like less memory at the cost of many more function calls

#

But at any rate, what happens here is that the recursive part is still doing dfs

#

But you still have iteration too

cold ferry
#

seems like it gets what you would want out of bfs

#

i guess it becomes a little hard to say whether it's technically, pedantically a bfs without having a sharper definition of bfs than i think people usually have in mind; it can visit the nodes in the correct order which seems fine enough to me (and that looks to match how wikipedia defines bfs, for whatever that is worth (well it depends on what "visit a node" will turn out to mean pedantically, i suppose))

noble skiff
#

I don't see how this is spoilers, these are abstract algorithms

#

I agree it achieved the same goals as BFS

rancid creek
#

Bwahahahah....

noble skiff
#

But it is also slightly different, my main point was that exact transcription of a recursive Algo to iterative is very easy and natural

#

The other way less so

cold ferry
#

it's the lack of a queue that's causing the problems, right?
you can turn your loop into a recursion pretty easily

rancid creek
#

bfs or dfs can be done with a loop and a queue, pop left or right depending on which you're doing, recursive though I think you're stuck with dfs and backtracking.

noble skiff
#

Yeah it can certainly be done

#

Just with iteration, bfs or dfs is a one line change

#

Both feel very natural

#

And many intermediate searches, you just change the data structure

#

With recursion you tend to tie yourself to the call stack

maiden brook
hidden musk
#

is it really that hard though?

S = [root]
out = deque()
while S:
  n = S.pop()
  out.appendleft(n)
  
  S.append(n.right)
  S.append(n.left)
noble skiff
#

Pretty much

#

Or use a stack for that matter

#

With recursive approaches there's always this implicit data structure there, even if it's not really the right one

#

Versus when you control it explicitly it's easy to use the exact data structure you intend, and easy to make that data structure a stack if you want to mimic a recursive algorithm precisely

forest basalt
#

Does anyone know when the timer starts for a day? Like I clicked on 2 to check it out and then did it later. Does it start when you click on the challenge?

bright haven
velvet stag
#

it starts at midnight of that day

forest basalt
#

Ahh okay that makes sense

maiden brook
noble skiff
#

i agree there are cases where the recursive version is more natural, just saying the transcription one way I find consistently easier than the one going back

#

I also find that while recursive solutions can be more elegant for problems where they "natural", once you start adding weird conditions, more requirements, etc, making things just generally less elegant, more complex, it gets easier to shift to the non-recursive solution. Because, again, you can explicitly manipulate the data structure, which I think as the problem gets harder, is more straightforward than trying to arrange your recursive traversals just so

dim sphinx
#

hi guys

woven sable
#

Hey!

earnest forge
#

Good luck everyone

north silo
#

.aoc countdown

hidden copperBOT
#

Day 13 starts <t:1639371600:R>.

north silo
#

gl!

sonic silo
#

whoop

north silo
#

I woke up literally 2 minutes ago, so this should be fun lemon_sweat

peak dock
#

πŸ‘€

woven oriole
#

begins in

#

3

hidden copperBOT
sinful pawn
#

oops

signal grotto
#

transparent origami

#

nice

ripe ingot
#

what does the question even want me to do?

#

its too... difficult to comprehend the question

heavy jetty
#

advent of code is killing me

stable heron
#

this ones easy but 😭

sinful pawn
#

I always get offended when people say these are easy tbh

heavy jetty
gloomy kernel
#

Lol

heavy jetty
#

this is dumb

#

i tried solution code and my code

#

my code was off by 1

gloomy kernel
#

Aoc is hard today

heavy jetty
#

my answer was 1675

#

the solution was 1676

#

this is just sad

gloomy kernel
heavy jetty
#

im sad

#

my life is sad

gloomy kernel
#

Tragedy 😭

tiny pumice
#

How to activate the easter egg in day 12?

gloomy kernel
#

I didn't figure it out

#

Yet

stable heron
#

GAHH I have an exam now 😭

pearl moon
#

Ugh numpy has some stuff to make today's easy but I can't get VS Code to find it

stable heron
#

I am sooo confused rn...

sonic silo
#

off by one errrorsssss

#

it was working so well

minor pike
iron reef
#

The elves had terrible handwriting

minor pike
#

(I'm only on day 3 lol)

iron reef
#

They succeeded in making all caps difficult to read

balmy dome
#

They should add a light mode

minor pike
#

this is my 3rd year and every year I do better than the year before :)

limber needle
#

i used the private code to join the pydis leaderboard but it's some random's private leaderboard wth

sharp panther
limber needle
sharp panther
#

Certain staff members own the leaderboards, which the bot compiles into a single one.

sharp panther
granite panther
#

What language does the first place global leaderboard use

limber needle
#

i'm going to say rust

bold needle
#

In part 2 do we have to tell the letters formed by the dots?

sharp panther
#

As long as your code isn't really slow to execute, the language you use isn't that relevant

tight dune
#

huh

#

it seems i have skipped dya 11

#

day 12*

#

and am attempting day 13 directly

woven solar
#

I wouldn't really expect anything but Python/JS/maybe R in the tops - programmer time matters a lot here

tight dune
#

ugh im trying to keep up with others

tight dune
woven solar
#

right, ruby too

humble copper
#

||how do i take the points and turn them into 8 capital letters|| im so confused

woven oriole
#

same

pearl needle
woven oriole
#

||first of all i need to print dots and #||

tight dune
#

i havent even done part 1 yet πŸ˜”

#

i insist on adding typehints, errors etc to my code

#

not ideal for golfing at all

sonic silo
#

are matrix diemnsions odd or even?

humble copper
#

||desmos isnt telling me much||

heavy jetty
#

what in the world is that

limber needle
#

should've used excel

humble copper
#

||i thought of plotting the points and seeing if they created letters but apparently not||

tight dune
#

ever

limber needle
#

the only way

tight dune
#

it is da wae

#

alr imma go code rather than meme around

pearl needle
woven solar
sonic silo
#

how can you even fold an even matrix like this

woven solar
#

oh, I see what you mean, yeah, you're right MidZik

tight dune
#

1 question

#

the grid is always gonna be even numbered right

sonic silo
#

is it??

tight dune
#

because u need to split it

#

in the middle

#

equal on each side

pearl needle
#

no it will always be odd actually

#

(until the end at least)

tight dune
#

if u see
its split equally

pearl needle
#

yes

bright spindle
tight dune
#

oh yeah

pearl needle
#

oh, yeah i guess that's possible

bright spindle
#

||Imagine folding a paper, you don't have to fold it in the middle||

humble copper
#

i just realized what ive been doing wrong

rough siren
#

how do you find the code

#

like what's the code here

bright spindle
pearl needle
#

someone is going to use ocr for this

humble copper
rough siren
#

second part is too tough

#

it's so tough to read

peak dock
#

not if you print prettily :P

stable heron
#

why is the entire column becoming '#'??

#

😭

#

its working if i use a numpy array 😭 πŸ’€

bold needle
peak dock
#

||print("\n".join("".join("β–ˆβ–ˆ" if x == 1 else " " for x in r) for r in grid))||

honest nacelle
#

Out of curiosity, anyone know how many possible inputs/solutions there are? I only once got an error that I got "someone else's solution" and it made me curious

earnest forge
honest nacelle
#

Ah so it may vary from puzzle to puzzle? That's interesting...

earnest forge
# honest nacelle Ah so it may vary from puzzle to puzzle? That's interesting...

I believe that the majority of the puzzles have randomly generated inputs, with some more complicated ones (e.g. intcode programs, 2019; puzzles which output text, puzzles which are computationally expensive to generate) having either hand-crafted inputs (e.g. for intcode, Eric wrote an assembler which then had some randomised options for its assembly target) or checked random generation. I'm not familiar with the internal workings of AoC though, so I may be very mistaken

livid gull
#

what character are you using for the output? it looks nice:)

peak dock
stable heron
#

GOSH IM SO STUPID LMAO

livid gull
livid gull
# peak dock β–ˆ

whats your print statement look like i can get them to work with the unicode symbol

onyx plank
#

AoC shows the following example:

#####
#...#
#...#
#...#
#####
.....
.....

It then says there are 17 dots that are visible. Are there only 16 and it's a typo or am I stupid

peak dock
#

is the dot

onyx plank
#

yes

peak dock
#

wait

#

hmmm

onyx plank
#

5 on top, 5 on bottom, 3 on each side

#

or i forgot how to count

#

after 12 days either are possible tbh lmao

livid gull
#

after the first fold

hollow wharf
#

umm

onyx plank
#

ok so yeah it's the im stupid part LOL

maiden brook
onyx plank
#

it's bc at the bottom I assumed it counted the dots in the final square, not after first fold

#

carry on fellas, nothing to see here

peak dock
bold needle
peak dock
#

its not very large after the last fold

bold needle
#

How many points are there after the last fold?

peak dock
#

6 rows 40 columns

bold needle
#

Oh, then I'm doing something wrong

stable heron
#

well im done

#

but i wasted 40 minutes

#

because i had economics exam 😭

woven oriole
#

thats just a representation for the final output

#

no code logic involved

#

spoiler please

stable heron
#

inputs are diff for everyone tho-

#

O.o

woven oriole
#

still

stable heron
#

okay

bright spindle
woven oriole
#

alright

bright spindle
#

Problem description interpretation is part of the challenge.

bold needle
#

My first fold is coming correct but subsequent folds are getting messed up

restive imp
#

omg, part 2 is amazing

bold needle
#

How to hide decimal ticks in matplotlib?

jade atlas
sleek lark
#

@hollow wharf You mean... Your algorithm goes through at least 100 iterations over a 10x10 grid in less than 1000 clocks cycle ? Stop bragging about that time and think

pearl moon
#

Man today's really can be done in like 10 lines and I actually used 100+

#

Well at least looking at concise solutions helps me to know what's possible

#

My brain is still in JS world where I can't rember how to do the equivalent of a map function

weak torrent
#

like c'mon what does this mean?

#

from where this capital letter come?

sleek lark
weak torrent
#

but we are folding the transparent paper

#

should I see what the folded shape is and write that?

sonic silo
#

yes

hollow wharf
#

hey

#

pzl help

#

me

sleek lark
#

@hollow wharf Sure what is blocking you ?

halcyon zealot
#

Is it too late for advent of code?

mint hornet
#

you can still come and play

#

And have a chance of getting into leaderboards from tomorrow.

hollow wharf
#

hello. I don't suppose this is a spoiler but what's the most pythonic way of getting the input for Day 13?

sleek lark
#

@halcyon zealot all advent of code from 2015 are available. You can still join us discussing any day of the calendar you want

#
With open(path,'r') as file:
    for line in file:
        ....
hollow wharf
sleek lark
#

What I did for today was :

line= file.readline()
while line != '\n':
   ....
   line = file.readline()
for line in file:
    ....
sleek lark
#

You could also use :

if 'fold' in line:
    ......
else:
    ...
#

Boi, writing code on a phone is something....

sick crag
#

i just did

points, folds = file.read().split("\n\n")
points = [list(map(int, p.split(","))) for p in points.split("\n")]
hollow wharf
sleek lark
floral flame
#

#bot-commands

fossil cipher
sleek lark
fossil cipher
#

AoC inputs are pretty small, so never think twice about just slurping it all in in one go πŸ˜„

torpid elbow
#

I'm having trouble at part 2 of day 1 xd

sleek lark
pale heath
#

In part 2 (day 12), we can visit one small caves 2 times, but rest of small caves (not visited 2 times) can be visited only 1 time?

wooden jewel
#

correct

#

and you can't visit start and end twice

pale heath
#

I never did anyway

wooden jewel
#

hmm that caught me out slightly

pale heath
#

when end was found I didnt expend path

#

and I ignored everything with start

reef dragon
#

Hi, how can i solve day 6 part 2? Just for the example, there say there are 26984457539 laternfish after 256 days. The way i'm doing it is storing every fish as a number of days till reproduction, but that would mean that an array of 26984457539 8bit numbers use 25.13gb of ram. So that probably isn't the way to do it. So how can i do this?

bright spindle
reef dragon
hollow wharf
#

Hey

bright spindle
#

Hey

rapid wolf
hollow wharf
#

Ok sure

woven oriole
#

is it this much or the full logo πŸ‘€

wooden jewel
woven oriole
#

hmm lemme fix

#

did you make it ? or found on the subreddit

wooden jewel
woven oriole
#

cool

wooden jewel
#

(it's not that different from solving the puzzle, you're just doing the same thing in reverse with some randomness of where to put the folds)

woven oriole
wooden jewel
woven oriole
#

and then the reverse stuff

wooden jewel
woven oriole
#

i see

pale heath
#

Is it true that weekends are harder?

rotund rapids
pale heath
#

I need to still do todays

#

after making yesterdays

#

should it be easier?

#

like generally because difficulty is very personal here

rotund rapids
#

it get's harder generally every day, but as you said it's a bit personal

#

but yeah, I'd reckon today you don't need to know any advanced topics to solve it

pearl moon
#

It's still in cs 101 phase in terms of algos it expects you to use, so nothing crazy

bright spindle
sonic silo
#

^

#

deeper knowledge makes it easier to racionalize the harder days, but ultimately a dsa/cs 101 and some intuition is all youd ever need

wooden jewel
#

"racionalize"?

pearl moon
#

If you do remember those algos, even on the surface level, it's just a Google away for an easy starter implementation

#

Which makes sense. It's more important to remember "I can use this existing tool" than "I can remember how to build this tool from scratch and then use it" IMO

fossil cipher
#

Yeah, knowing the type of problem you're facing goes a long way towards how difficult the puzzle will be

marble iron
#

Hi guys is tutoring available in this discord? Or just general homework help for beginner python

bright spindle
bright spindle
sonic silo
sonic silo
bright spindle
#

Maybe it's too technical.

wooden jewel
sonic silo
#

no

wooden jewel
#

(not a native speaker)

bright spindle
#

It doesn't really convey that meaning in English.

sonic silo
#

no its not an actual word, i intended to say "rationalize"

bright spindle
#

I mean "rationalize" doesn't convey that meaning either.

#

It's a false friend

sonic silo
#

hmm

bright spindle
#

Yeah, but not that definition

sonic silo
#

is reason a better alternative?

bright spindle
#

Well, the one you used "model a solution" sounds much better.

sonic silo
bright spindle
#

The most common meaning of rationalize in English is to try to explain something away using logic in order to hide the true reason.

sonic silo
#

i see

bright spindle
#

It makes sense, anyway. Whether it captures the same exact meaning is I guess hard to know for sure.

sonic silo
#

i guess so

hybrid sage
#

Hi I am trying to write a programme with an outer function which takes three arguments from a user: apples, pears and oranges. Then trying to create an inner function within this outer function, which divides the apples by oranges? Anyone please help

sleek cave
#

this is the most dedicated I've ever been trying to solve a puzzle... call stack with call and pop order indices (starting at 1 for my easy understanding lmao)
I am determined to solve day 12

robust heart
#

I'm officially stuck at day 9 part 2 it's awful

low condor
robust heart
low condor
low condor
clever pecan
#

i found yesterday's to be pretty tedious

sleek cave
low condor
#

I quite like yesterday actually

#

it can be written pretty short and elegantly

proud cosmos
#

Was pretty easy but nice as well yea

#

Maybe I just got lucky

hollow wharf
#

is today part 2 just ||do all the folds||?

#

alizΓ©e had a very nice solution for yesterday

sonic silo
#

||yes||

#

||then read what the output spells||

hollow wharf
#

cool, thanks

sleek cave
#

FK YES

proud cosmos
#

Nice!

sleek cave
#

THE CALL STACK WORKED

#

omg and it's a clean solution :chefskiss:

low condor
#

now for part 2 πŸ™‚

hollow wharf
low condor
wooden jewel
#

(finally got a holiday themed profile picture)

#

might be a bit too subtle tho

hollow wharf
#

i have a question

#

if data[index] == True
print("idk")

#

i dont get this

#

im so dumb and forgot

#

is it a array?

low condor
#

this channel is specifically for the Advent of Code website challenge

#

but if you open a help channel, someone can help you with that

sleek cave
#

ah yes, classic programming. when things don't work:

  1. increase/decrease indices by 1
  2. change <=s into <s and >=s into >s

second worked for me :D

hollow wharf
#

didn't know string answers were a thing

sleek cave
hollow wharf
#

well the answer for part two wasn't numerical

low condor
#

it has happened before I'm sure

pliant comet
#

yeah, there was a day in 2019 that i remember was quite similar

low condor
sleek cave
sleek cave
pliant comet
sleek cave
maiden brook
#

what happens to this channel after christmas? pithink

sharp panther
#

It'll probably stay for a while, and then get archived.

narrow crown
#

is it just me or does this look like a rabbit

#

and im so behind on aoc lol

woven sable
narrow crown
#

yes please :D

woven sable
#

It's an underground water cave

#

with some magma

narrow crown
#

oh nice

woven sable
#

and an underwater volcano

narrow crown
#

ive only done a few days

#

ohh i see how it looks like that now

woven sable
#

ah

narrow crown
#

k ima try to catch up a bit

narrow crown
#

For day 3, how can I delete all the lines with line[bit] being the lesser common number other than iterating through the list?

#

is list comprehension just the way to go

sleek cave
narrow crown
#

o right

#

o2_common = "1" if count > 500 else "0" is it possible to have an elif in this as well or do you have to make it a long if, elif, else thing if you do add it

pearl moon
#

I think if you want to put an additional ternary in there, you'd have to nest it like o2_common = "1" if count > 500 else ("2" if True else "3"), right?

narrow crown
#

oh cool thanks

pearl moon
#

I'd double check that, I'm not very good at Python....just run it I guess

#

Yea it parses for me

sinful pawn
#

I thought that's where I was for second

narrow crown
#

oh sorry

north silo
#

.aoc countdown

hidden copperBOT
#

Day 14 starts <t:1639458000:R>.

earnest forge
#

Good luck everyone

tight dune
#

AAAAAAAA IM doing day 12 now

woven oriole
#

pause

earnest forge
#

refocus on day 14, you might even get points

tight dune
#

but im so close πŸ₯²

prisma sundial
#

today feels like a leaderboard day

hollow wharf
#

today feels like parsing hell

prisma sundial
#

those are my best days

earnest forge
tight dune
#

true

#

ig ill do it

woven oriole
#

GL

hidden copperBOT
velvet knot
#

first

foggy zealot
#

second

tight dune
#

seems ok

velvet knot
#

why does this one look easier than the last 4 days

pine tiger
#

lmao
do any of you guys
have any idea
how to do this

stable heron
#

im on part two

#

😭

hollow wharf
#

ok, part 2 neeeds servere optimization

stable heron
#

yep

narrow crown
#

how is it

pearl moon
#

Yea was gonna say

#

Part 1 so easy with naive solution....

pearl needle
#

lanternfish have turned themselves into polymers

earnest forge
#

Lol

jade root
#

aaaaa

#

how

earnest forge
#

Good algorithms

jade root
hollow wharf
#

hi

jade root
#

helo

hollow wharf
#

how are you?

summer kraken
#

That's why this problem came.

jade root
#

i dont know how to apply my knowledge from day 6 for today's puzzle

hollow wharf
#

ok

honest nacelle
#

GAHH I know I learned this in college but I cannot for the life of me remember...

clever pecan
#

part 2 was sooooooo much harder than part 1

bright spindle
#

||It's the classic exponential problem with a bruteforceable part 1 and non-bruteforceable part 2||

#

||Like the lanternfish||

muted aurora
#

Would anyone be interested in a semi-reliable way to fetch the sample inputs for each day through a script as well?

strange zinc
#

I'd like something to get my inputs for me

#

To lazy to code one up

dark slate
#

I've no problem copy-pasting
It's not a problem, so I don't think it requires a solution

#

I feel it would complicate things, having to deal with the input grabber as well as the puzzle itself

#

But maybe it would be useful for those doing the challenges in the future, like grabbing them and an easy way to test the solution against them

devout tusk
#

||Is part 2 telling me to create an efficient CFG implementation or is it possible using a hashmap?||

#

hints only please. I want to figure it out on my own

pearl needle
dark slate
#

||yes you can use dict/map||

devout tusk
dark slate
#

what are those words xD
probably overthinking it

iron reef
#

The solution is way easier than that

pearl needle
iron reef
#

That's literally the solution

#

which means it should be in the channel three channels down

pearl needle
#

fair enough

devout tusk
iron reef
#

At 999 days the answer gets pretty big, 6.78622117757187e+301

proud cosmos
#

I dare you to find out the 999th character of the day 999 string

pearl needle
#

that's easy tho

iron reef
#

That's actually also trivial computation time

proud cosmos
#

Yeah isn't that hard of a challenge as I thought about it more

muted aurora
#

Is it trivial? How would you get the 999th character?

pearl needle
#

because of the way the string grows

proud cosmos
#

Well after 999 days you can basically guarantee only the 1st pair of input matters

iron reef
#

999x999 isn't big

proud cosmos
#

and you can jsut throw everythingt away after 1000th char

pearl needle
#

the 1001th character will never affect the 999th character

muted aurora
#

Ah i see

proud cosmos
#

Could prob even solve this the naive way

#

by just cutting after 1000

#

lol

muted aurora
#

Sure, I guess you'd need a little bit of a smarter implementation for that, I thought you just mean it's trivial from the regular implementation for the problem

proud cosmos
#

It should be trivial

pearl needle
#

yeah the algo would be different

#

but that's because it's asking for something different lol

iron reef
#

Python starts to hit integer size problems for me at 9999, need to go to alternate math handling libraries to go further

proud cosmos
#

integer size problems

#

python

muted aurora
#

python has arbitrary precision integers

pearl needle
#

what are the max number of bits an integer can have in python lemon_thinking

muted aurora
#

just ran mine for 15000 steps, looks fine to me

iron reef
#

There's a last operation for display that moves it out of pure integer math range

drifting condor
#

.aoc unsubscribe

hidden copperBOT
#

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

muted aurora
#

Answer has 4500 digits lol

muted aurora
bright spindle
#

It was a bit slow, but it works.

mossy stream
#

sir

#

this is not how polymerization works

maiden brook
#

right? you need time wizard and baby dragon

bright spindle
#

You need polymerase chain reaction!

jade root
#

yay i finally did it :D

pearl needle
devout tusk
#

I thought that ||counting these at each step would work. I am dumb, I guess. Idk how I am supposed to get individual counts now || πŸ€¦β€β™‚οΈ

proud cosmos
#

Maybe it's possible

devout tusk
proud cosmos
#

||If you have that consider if you could get the total amount of characters based on the rules the pairs are based on|| d14p2 solution part

devout tusk
proud cosmos
bright spindle
devout tusk
devout tusk
peak dock
proud cosmos
ruby epoch
#

Also spoiler bars are redundant if you don't mark what they're spoilering. Otherwise people will click on them anyway just to see what's underneath

proud cosmos
#

Fair

pearl needle
bright spindle
#

||Like, disregard pairs, just think of the string itself before and after||

devout tusk
muted aurora
pearl needle
#

but as an FYI, there are other methods. dementati was hinting towards another solution that works, which is completely different from this method.

bright spindle
#

Not the one I used but one I think is maybe a bit more elegant.

pearl needle
#

yeah I think it is the most elegant too

devout tusk
#

FINALLY DONE

#

ffs stupid mistakes today

#

my code's convoluted af but runs both parts in about 3ms

proud cosmos
#

Nice!

cursive tulip
#

.aoc join

woven oriole
#

pog

proud cosmos
#

Impressive

sleek cave
#

i see exponential growth
i see a deceptively easy part 1 that can be solved by simulation using a string
hmmmmmmmmmmmmmmmmmm something ain't right

sleek cave
#

flashbacks to lanternfish

wooden jewel
devout tusk
woven oriole
wooden jewel
#

that's pretty nyoom, can I see your code?

honest nacelle
#

I'm just here to vent about being stuck 😩 first time I've been absolutely stumped even after sleeping on it

honest nacelle
devout tusk
honest nacelle
#

πŸ‘€ in that case I might be able to intuit something

humble escarp
#

Woohoo

honest nacelle
#

wait wait... I think I've stumbled upon something

#

I'm either about to have the biggest brain moment of my life or I'm going to cry lots and lots

rancid mural
#

this one was a tomorrow-morning solve

honest nacelle
#

Turns out it was b) cry lots and lots

humble copper
#

so i got the algorithm working
and it gave me the right answer
but when i put it into aoc it was telling me it was wrong
i was wondering why, and then i realized
i gave it the answer to the sample input

#

thats better

woven oriole
#

thats why i fetch puzzle input using requests and overwrite it against the sample input by calling a function , so that saves time

wooden jewel
#

Yeah, if I wanted to seriously compete I'd also do that next year

#

But that'd involve getting up before 6am an entire month

#

Not sure if I can handle that

noble skiff
#

part b) is definitely the first time I've genuinely been stuck as to basic approach this year

torpid elbow
#

Anyone care to explain to me why with this code :

list1 = ["N", "N", "C", "B"]
for n in range(len(list1) - 1):
  aa = list1[n] + list1[n+1]
  print(aa)```
#

gives :

NN
CN
CN```?
muted aurora
#

!e

list1 = ["N", "N", "C", "B"]
for n in range(len(list1) - 1):
  aa = list1[n] + list1[n+1]
  print(aa)β€Š
marsh currentBOT
#

@muted aurora :white_check_mark: Your eval job has completed with return code 0.

001 | NN
002 | NC
003 | CB
sleek lark
#

Better

proud cosmos
#

Trick question!

torpid elbow
#

what...

#

the numbers are n btw

muted aurora
#

You might have something else messing up your loop

sleek lark
muted aurora
#

I prefer me some:

for a, b in zip(list1, list1[1:]):
    print(a+b)
sleek lark
muted aurora
#

Definitely not

#

But looks cool tho

#

My point was that it eliminates possible indexing mistakes

bright spindle
sleek lark
#

introducing ''.join() would have been a bit more accessible for starter

hidden musk
#

joining 2 strings seems kinda weird

sleek lark
muted aurora
# sleek lark what ?

Seems kinda weird to do ''.join((a,b)) rather than just a+b if they're strings already

torpid elbow
bright spindle
torpid elbow
#

lol

#

k

bright spindle
#

You can solve the entire problem using only example input.

fossil cipher
wanton tangle
ruby epoch
#

The example is literally test data. It helps you know if your code is working correctly because you can easily just stick it in pytest or unittest and go from there

jade atlas
#

is it the cave system that is getting drawn in the main page?

whole nova
#

my pfp is what i keep getting

#

where do igo

#

which channel

bright spindle
whole nova
#

it doesnt work for me

bright spindle
#

This channel is for discussion of the Advent of Code event.

whole nova
#

ok

bright spindle
whole nova
#

ok

fossil cipher
bright spindle
fossil cipher
#

waits for optimise crafting order with pile of raw materials puzzle

#

I need to finish Below Zero. I think I'm about half way through the story. First game was amazing, barely put it down πŸ˜„

bright spindle
#

It might very well be my favorite game of all time.

fossil cipher
#

Gotta love a game that regularly takes you a on journey of absolute wonder, spine-tingling creepiness to abject pants-shitting terror πŸ˜„

bright spindle
fossil cipher
#

lol!

bright spindle
#

It's not the most difficult fight in the world, but that thing had made feel such primal fear for such a long time, and that made the victory feel somewhat primal as well.

sinful pawn
#

I always feel like a cowboy when I grapple onto leviathans and just punch them to death

fossil cipher
#

finds new interesting cave
distant roar

honest nacelle
#

This problem is going to drive me insane...

noble skiff
#

yeah, this is first one that took me a lot of thinking

eternal forge
#

Could someone give me some advice on todays P2? Without spoiling an actual solution, just some ideas on how to think, if that's possible πŸ˜„ Spoiler: || So currently I just loop over the polymer template and match it with the pair insertion rules in a dictionary and then add it to a new list, and do this x-steps, so the solution "stops" after ~20 steps as the list with polymer becomes way too huge to continue. I was thinking about having the polymer as a dictionary and just store the amount of times the letter-combination appears, like "NB": 5, but then I will have issues counting the amount of letters in the end||

noble skiff
#

@eternal forge the thing you think is an issue is actually pretty simple. you're on the right track for sure.

vagrant inlet
#

I have a question about 2 codes im trying to find errors and corrections for. Would I be able to get assistance here?

hollow wharf
#

Hello, can anyone tell what those grey stars mean? (this is from private leader board of this server). I made all 8 days in a row, and just interested why it does show for me 1 gray star. if anybody knows

rapid wolf
#

grey stars mean only part 1 done

hollow wharf
#

Oh wait, this list is updated every 30 min, maybe that is the deal. Totally forgot bout that. Sorry

hidden musk
#

just refresh the page, that one should update real time

eternal forge
noble skiff
#

@eternal forge probably just easier to discuss in the spoilers channel

potent pumice
#

the command is updated every 30 minutes.

hollow wharf
#

Okay, thank you :)

low condor
#

Just finished Day 14!

proud cosmos
#

Nice!

low condor
#

I like how ||it's essentially Day 6 lanternfish but with a bit more thinking required||

low condor
#

Let me guess - you'll use recursion πŸ˜›

sleek cave
# low condor Good luck!

thanks! although i'll actually be quite surprised if i solve this without any hints, i struggle on these efficient algo puzzles

#

makes me feel like in a coding interview lmao

sleek cave
low condor
sleek cave
#

didn't have time to do d13 πŸ˜” homework is being a major bruh moment
i'll complete all incomplete days once christmas break starts

#

day 13 doesn't seem too challenging, though (at least part 1 doesn't)

magic scaffold
#

Ok I joined it

honest nacelle
#

I'll never understand how 100 people solved this in under 15 minutes...

sleek cave
sleek cave
sleek cave
#

ah nice

magic scaffold
#

Is there any command to see score for a user ?

magic scaffold
#

Imo the hardest was the 7 segment display

hollow wharf
#

hello

sleek cave
#

the most complicated for me, but not the hardest

#

day 8 (7sd) wasn't hard imo, just pretty complex and long

honest nacelle
# magic scaffold Which problem?

Today's 😩 been stuck on it since midnight, got a little help in spoilers and I've got part of it now, just need to figure out the rest. The display one was relatively easy for me

honest nacelle
#

but as the creator says, different days will be harder or easier for different people based on how their minds work and what experience they have

honest nacelle
low condor
#

Indeed. The one most people complained about last year, I found fairly easy - but then I got stuck on one most people found easy πŸ™‚

magic scaffold
#

Yh it's a bit tricky one but I won't spoil it for you, just write it on pen and paper and closely look at each step

honest nacelle
#

thanks, I'm so so close to getting it I just need to figure out how to COUNT UUUUGH

#

feels good to be able to vent in here though lol

magic scaffold
#

i wonder how you keep a counter πŸ€” ?

honest nacelle
#

I just want to be able to step into the mind of the people in the top 100, see how their brains work things out so quickly. I wish there was a speedrun-esque recording system lol