#advent-of-code

1 messages Β· Page 42 of 1

sleek cave
#

don't-know-how-to-use-numpy moment

#

true, i'll worry about efficiency later. for now, quadratic complexity it is

deep ferry
shrewd osprey
deep ferry
#

i just searhced stackoverflow

sleek cave
#

lmao

#

i'm going for a vanilla solution, i feel like i'll lose my sanity at some point

#

wish me luck

signal grotto
dark arrow
#

Hey, can I keep days of aoc as pending or do I have to activiely do it everyday? ie can I do a week's worth of aoc question next Sunday and have 14 stars?

signal grotto
#

You can ever do past problems from all the way back in 2015, no time limit

dark arrow
signal grotto
#

Example

bright haven
#

every year is 50 stars

#

(though I don't know where that stars/year page is that @signal grotto showed)

woven oriole
#

but that has nothing to do with the leaderboard right

#

πŸ‘€

bright haven
signal grotto
woven oriole
#

the one which lancebot fetches i meant

#

hm i think so

#

yes nvm

signal grotto
#

Ah correct, lance only fetched the current year

signal grotto
#

But yeah basically each year is a totally separate event with different leaderboards, stats, everything, but you can still access all the previous events

sonic silo
#

by the end of this year you can get up to 350 stars

woven oriole
#

the real challenge is to be consistent for the 25 days smh

sonic silo
#

i was half consistent last year

#

as in, "got all stars on time"

dark arrow
humble copper
#

WHAT

bright haven
humble copper
#

idk what changed between the first attempt and the second but i got it to work

humble copper
hollow wharf
#

help i cant sollve itt

#

help me

signal grotto
#

(no quotation marks needed, we can now handle spaces in names)
heyyy that was me, I did that part πŸŽ‰ πŸ˜‚

wide dust
#

.aoc link OSEP

hidden copperBOT
sleek cave
#

woohoo part one completion

potent pumice
#

wait I commented on it and ensured that was true for the link command πŸ˜‚

sonic silo
#

.aoc link eiyashou

hidden copperBOT
bold needle
#

On the leaderboard on the aoc website, it's showing my rank different as compared to the leaderboard provided by the bot

minor cave
#

Due to the size of our community we need multiple leaderboards. So we query all of them, re-rank, re-score, and then produce the output here

bold needle
#

Oh, ok!

potent pumice
#

@minor cave is there not an unlink command?

potent pumice
#

yeah that should have been obvious πŸ€¦β€β™€οΈ

#

thanks!

candid berry
#

The traditional command to invoke unlink is rm

crisp coyote
#

Any guesses at what the picture is going to be? πŸ˜„

sonic silo
#

seabed

wintry kelp
#

Christmas Atlantis πŸŽ„

last egret
#

submerged Statue of Liberty...

sleek cave
bold needle
#

Submarine

crisp coyote
#

"stuff" being a seemingly random collection of multicoloured punctuation

#

where all the misused apostrophe's go

balmy dome
#

Sorry i have ocd but i am wuite well in programming can anyone help me with these challenges

low condor
low condor
#

maybe a help channel is better then

humble copper
#

im done

#

this took way too long lmao

livid gull
#

What code editors do you guys use for AOC?

rancid creek
#

visual studio mostly, sometimes vscode or emacs

#

pycharm is also popular with some people.

livid gull
#

I was thinking about learning vim

humble copper
livid gull
#

because i just use Python Idle and if i used something better i couldve probably gotten something better than 77th on day 1

humble copper
#

its just easier for me

sonic silo
junior hinge
#

i use vscode

sonic silo
#

specifically,

atomic frost
topaz summit
sonic silo
#

i should mention that i use a bunch of bash scripts alongside nvim for like. a lot of things

atomic frost
#

same lol

sonic silo
#

when it comes to developing puzzles in aoc

#

(and in general. just not as heavily)

atomic frost
#

i have one for download one for running with sample input and one for running with real input

sonic silo
#

also i love this lol

livid gull
sonic silo
#

cloc is an alias for ssc, another code line counter

atomic frost
#

i think it is probably a seafloor

livid gull
#

day 1 is for sure top of the sea, the blue . look like air bubbles

atomic frost
#

this reminds me i need to make my run bash script better

#

currently it runs the program twice

potent pumice
hollow wharf
#

like a journey to centre of the earth thing

sonic silo
#

and the nwe fight a dinosaur

hollow wharf
#

yes

#

we will meet cute dinosaurs

rancid creek
#

pretty sure it's an ocean picture.

sonic silo
#

i wanna fight a dinosaur

#

in AoC

rancid creek
#

we had sea monsters last year, does that count?

pale heath
#

huh entire day and I still dont understand how code that works on example input doesnt on real one

#

I guess Ill give up

sleek cave
crisp coyote
sleek cave
#

i see what you did there

short lava
#

day 4 is interesting 😩

sinful pawn
#

I hate day 4

pale heath
#

WOHOO I SOLVED IT

#

Im sooo proud and motivated rn

hollow wharf
#

I’m still really unhappy with how ugly my code is

sonic silo
#

i love day 4

sleek cave
#

I love every single day

humble copper
#

day 4?

hidden copperBOT
#

:x: @rustic cobalt, please (temporarily) enable DMs to receive the join code

pale heath
humble copper
#

nice

#

it was pretty difficult so great job for completing it

pale heath
#

Yes

frigid mural
#

What's stopping people from linking their discord ID to a name on the leaderboard that isn't their own?

#

when I linked mine it didn't check anything so I assume I could have gone through and picked the first guy on leaderboard not to have linked already and pretend thats me

patent blade
#

So, how hard do these problems get? I'm a tad concerned because day 4 took me over an hour, so if it gets several times harder than that at the end, I might not have the time or ability to finish?

loud yew
hidden musk
#

2020 day 25 wasn't that bad tbh

patent blade
#

Hmm that honestly doesn't look that hard

humble copper
#

it doesnt look so bad

#

definitely not as bad as this years day 4

minor cave
frigid mural
#

Fair enough, thanks for the reply :)

sinful pawn
#

oh yes. "it is me, LX.. where is my role"

brazen goblet
#

I only managed to link my account to github

placid lake
#

mmm i still haven’t gotten around to today’s yet

frigid mural
brazen goblet
minor cave
#

Like, it's going to be obvious if someone besides Oliver tries to link to their leaderboard name

short lava
#

Just ordered my advent of code shirt, first piece of programming merch I bought

sinful pawn
#

I wonder if you can do some of them automatically

#

if an account has GitHub linked to both AoC and Discord

minor cave
sinful pawn
#

oh, unfortunate

minor cave
#

So we have some other solutions vaaaguely in the works, but we didn't want to block this in the meantime

#

We'll always have some ability to manually link in the case of the anonymous users

sonic silo
#

2020 25 was relatively easy

#

you shouldve shown 2020 20

sinful pawn
#

I gave up on day 10

sonic silo
#

hell, day 25s are quite easy compared to the previous days

marble minnow
#

Hey, how are you guys checking how many bytes your code has?

woven solar
#

every ascii character is one byte

#

so unless you are using various unicode chars, it's just the char count

marble minnow
#

is space also an ascii character?

woven solar
#

yup

marble minnow
#

thanks

frigid mural
#

Throw it into code.golf if u wanna be quick about it

woven solar
frigid mural
#

pick a random problem and paste ur code in just to use their byte counter

woven solar
#
>>> len('ΠΏΡ€ΠΈΠ²Π΅Ρ‚'.encode("utf-8"))
12

cyryllic is 2 bytes per char in UTF-8, for comparison

hollow wharf
#

hey

marble minnow
#

o/

narrow crown
#

i still am on day3 part2 i just dont have much time to do much of anything ;-;

upbeat ice
#

it took me quite long to find the solution for day3 part2. but it was worth it ;)

hollow wharf
#

I FIGURED OUT A PRETTY SOLUTION FOR TODAY'S

#

FINALLY

steep basalt
#

Is it possible to link google, reddit and github to the same account?

#

I just signed up using my github and I wonder if I can link my google and reddit as well

hollow wharf
sharp panther
steep basalt
sharp panther
#

no worries

steep basalt
#

Once I signed up using my github, I can't seem to find an option to also link my reddit

#

Or any other service they allow (I'm positive that I saw google too, not sure if there were more)

low condor
#

I have the opposite problem - I signed up with Reddit but wished I used Github or Google instead

fresh forge
#

can someone help me debug day 3 part 2

signal grotto
#

https://twitter.com/ericwastl/status/1467243576966983685?s=20 just putting this tweet out here from the creator of aoc

If you're doing #AdventOfCode and learning stuff, but your code's a mess, you got the wrong answer, you're a few days behind, it took you several hours, you're in a language you're not familiar with...

All I hear is that you're learning stuff. You're doing great!! πŸŒŸβ€οΈπŸŽ„πŸ§‘β€πŸŽ„

Retweets

102

Likes

591

signal grotto
#

he really is

#

also if you haven't watched his BTS video for AoC, I highly recommend it

#

Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other. In this talk, the creator of Advent of ...

β–Ά Play video
sleek cave
hidden musk
#

i've only really done 2020, so probably the sea monster one

sleek cave
hidden musk
#

me neither

sleek cave
#

surprisingly, the hard question is easy to understand

low condor
#

Sea monster IMO wasn't that hard but it was long

sleek cave
#

yeah, i would have no idea how to approach this other than brute-forcing

low condor
#

I felt like I would never stop writing code that day

sleek cave
#

aoc questions in a nutshell:
blah blah blah blah blah
what is blah multiplied by blah?

#

they like multiplication so much lmao

signal grotto
#

good way to require finding multiple numbers and still submit one solution

#

those are our Python help channels πŸ™‚

sterile cedar
#

How do I play?

signal grotto
sterile cedar
#

ah calendar

#

found it

robust heart
#

Finally caught up with Adv 2021

#

Hope this time I'll manage to get past day 10 haha

woven sable
#

I don't think I'll make it

#

I was struggling on D4 today

#

This is when I start writing maintainable code

#

The reason I struggled is because I didn't know what my code did after a bit

hidden musk
#

it's all about the speed. the faster you do it, the less it matters when you forget what your local variables do

hollow wharf
#

i might just give up

woven sable
#

and you might be able to solve your puzzles

woven sable
sterile cedar
#

Lets go

woven sable
#

Yay!!

#

πŸŽ‰

sleek cave
digital ember
#

doesn't work for day 4

woven sable
#

Huh really? It worked for me

digital ember
#

would need to choose the bold part of pre.code

woven sable
#

Ohh that's cause I updated it on my own

#

And I didn't post the new one

digital ember
#

ah

#

paste it

#

interesetingly mine works for day 4

ivory venture
woven sable
#
resp = requests.get(url=self.url, cookies={"session": self.session})
        soup = BeautifulSoup(resp.text, "lxml")
        test_input = soup.pre.text.strip()

        current_part = soup.find_all("article")[-1]
        last_sentence = current_part.find_all("p")[-2]
        answer = last_sentence.find_all("code")[-1]
        if not answer.em:
            answer = last_sentence.find_all("em")[-1]

        answer = answer.text.strip().split()[-1]
        try:
            answer = literal_eval(answer)
        except ValueError:
            pass

        return test_input, answer
digital ember
#

cool thanks :D

woven sable
#

Np!

#

I'm gonna stop using my helper besides testing though

#

because it sends too many requests

digital ember
#

too many? why? would probably be only 2 on two different endpoitns

hidden musk
woven sable
#

I am not

hidden musk
#

well

digital ember
#

oh no, do it

woven sable
#

I honestly don't like my submit helper function though

#

I just like the testing feature of my helper

digital ember
#

coments πŸ™ƒ

sleek cave
#

@hidden musk your about me is simply cruel.

hidden musk
#

idk what you're talking about

sleek cave
#

the game

hidden musk
#

?

sleek cave
#

you made me lose it

#

the game, where the objective is to forget the game

sleek cave
#

or are you inferring about something else

tight dune
#

after some time i gave up trying to do it in the ipy kernel and switched to jupyter

sterile cedar
#

something's wrong with my

#

day 4

#

oh nvm my screen is just dirty

crystal shard
#

Time to go try hard mode and get that AoC completionist role!

sleek cave
#

3 hours.

#

advent of code is hands down the coolest programming event i've ever attended lol

sinful pawn
woven sable
sinful pawn
#

hmm

#

how accurate is that tho

woven sable
sinful pawn
#

perhaps I should make my own

#

but I'm busy being stuck on day 4

#

not even busy, I've practically given up

woven sable
sinful pawn
#

I... cannot stand things involving "boards"

digital ember
#

it doesn't work for most days < 2021 since the format is different, some days don't have inputs

topaz summit
rancid creek
#

day 4 goes pretty quickly once you have the data read in correctly.

sinful pawn
woven sable
digital ember
#

got a bit ahead on the watcher

#

lots of bugs though

woven sable
digital ember
#

it only works if you haven't attempted the problem before

woven sable
#

I hate them

#

that's why numpy! (I don't know how to use it :(

rancid creek
#

lists seemed fastest, numpy was a little slower, and pandas was a LOT slower.

digital ember
#

me who doesn't know numpy, and goes the lists way :(

sinful pawn
digital ember
#

not lucky, sometimes lists can get tiring

rancid creek
#

that's when you use set, dicts, etc...

#

or have fun with comprehensions

sinful pawn
#

god

#

2D sequences

#

absolute torture for me to comprehend

woven sable
#

Nested lists are a whole lot of "what the hell am I looking at?"

digital ember
#

\⚠️ ignore

sinful pawn
#

it wasn't even a 2D list, actually

#

my type annotation for my boards variable ended up being seq[seq[seq[int]]]

woven solar
#

numpy would be so annoying to typehint

#

you can't even do that without a separate package

#

and I think it doesn't allow nice typehints of sizes

rancid creek
#

no spoilers here, but I had a lot of indentation in my first version:

with 
    for 
        for
            if
                for
                    for
                        if
                            if
                                if
                                    print()
violet raft
#

im not sure what's wrong with my code, but it works for the example, but not the actual problem : (

rancid creek
#

with a few more for loops in the middle of comprehensions in there. πŸ™‚

rancid creek
sinful pawn
#

is this day 4? if it's day 4... this is exactly why I refuse to do it

sleek cave
# sinful pawn I... cannot stand things involving "boards"

i too find them hard to wrap your head around, especially when shit gets deep by adding more loops on the 2d-nested-loop. take today, for example, you have to loop through every number, and for every number, loop through every matrix, and for every matrix, loop through every array, and for every array, loop through every item

#

it's insanity

sinful pawn
#

I hear some Nim programmers use a specific module called "arraymancer"

#

but... I truthfully have no idea what it does

digital ember
#

well tried something out

#

could you guys test it

#

works on 2021 puzzles only

#

one bug

#

i need to reload the imports

sharp panther
#

Can you do a day before you do a previous day?

digital ember
#

yeah

sharp panther
#

ty

digital ember
#

oh shit, i forgot, I am passing the functions and not importing them

#

how do i reload it now?

sleek cave
#

it's really fun

sharp panther
#

Probably

#

but I've been busy the last couple days, and I want to do today's if I'm awake

woven sable
violet raft
#

does aoc get harder and harder as days go bye

#

cuz that's the trend im seeing

bright haven
#

yes, definitely

mossy basin
#

it will probably get slightly easier on monday, but continue to get harder over the week

tiny pumice
#

Hi, how to get the AOC role?

sharp panther
tight dune
#

i hope this time's problem is easier than yesterday's

candid berry
#

I went to a wedding today and had several many drinks. Today's will be a challenge...

tight dune
#

i have class during the problem

#

apparently they dont care if it's sunday

candid berry
#

☹️

woven oriole
#

lmao

woven oriole
#

they prolly are behind syllabus completion smh

sleek cave
woven sable
#

ngl I despise nested lists so much

#

whenever I see "make a game board" I cry inside

#

because I know I'll need to use nested lists

hollow wharf
#

getting hype for day 5

woven oriole
#

today difficulty should reach its apex for this week

#

sunday goes brr

hollow wharf
#

Hopefully a nicer data structure than yesterday

#

trees or graphs or something pls

woven oriole
#

NOT BINARY TREES

#

no

hollow wharf
#

Binary trees are so easy what

woven oriole
#

i mean i never worked with them yet

#

i dont think they'll literally go into core concepts , if they even went , they'll explain what it is

#

πŸ‘Œ

hollow wharf
woven oriole
#

will prolly read about them

#

πŸ‘€ also i have to continue rust book

jade atlas
#

.aoc c

hidden copperBOT
#

Day 5 starts <t:1638680400:R>.

signal grotto
#

who's excited??

earnest forge
#

GLHF everyone

unique osprey
#

I'm ready for some submarine action

signal grotto
#

wonder what craziness the sub will encounter today

hidden musk
#

πŸ‘€

#

.aoc unsubscribe

hidden copperBOT
#

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

craggy mural
#

πŸ‘€

woven oriole
#

.aoc c

earnest forge
#

Gotta get your veggies :P

hidden copperBOT
#

Day 5 starts <t:1638680400:R>.

signal grotto
#

leek as in the vegetable? 🀣

hidden musk
#

the squid will eat us

#

yeah, gotta avoid scurvy

earnest forge
#

I wonder if it's a Despair Squid

summer kraken
#

.aoc unsubscribe

hidden copperBOT
#

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

quaint hare
#

lol auto typo cheeker

signal grotto
# hidden musk the squid will eat us

"The squid didn't like that you beat it at bingo. It is plotting its revenge, but you intercepted its brain waves and need to stop it before it destroys you and the submarine."

hidden musk
#

😩

#

pt 1 you need to reprogram its brain

#

pt 2 it was wearing a tin foil hat

pearl needle
#

the squid needs your credit card information

prisma sundial
#

gl

tulip elbow
#

hf

summer kraken
#

.aoc c

hidden copperBOT
#

Day 5 starts <t:1638680400:R>.

north silo
quaint hare
#

10 secs

woven oriole
#

10

#

5

hidden copperBOT
signal grotto
quaint hare
#

it's on

sinful pawn
#

oh. that's what I forgot to do

woven sable
#

Oh it's 12 AM

#

I'm in the car

#

Guess I'll code on phone

quaint hare
#

field of hydrothermal vents on the ocean floor!

woven sable
#

Aw this one isn't as hard as I thought it'd be, wish I was at home for this

hazy pendant
#

AW HELL NAH

woven sable
#

Coding on phone is unpleasant

hazy pendant
#

LINES
AAAAAAAAA

sinful agate
#

my brain can't comprehend

outer chasm
#

interesting

quaint hare
#

idk geometry math

ripe ingot
#

this is too much

outer chasm
#

I just woke up as well

hazy pendant
#

MATHS

#

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

quaint hare
#

1st one doesn't need math actually

hazy pendant
#

YOU'D ALSO HAVE TO CHECK INTERSECTING LINES

#

A POINT THAT INTERSECTS 3 LINES

quaint hare
#

that is the only thing you have to check

hazy pendant
#

this is hell

#

aight

quaint hare
#

I'm gonna talk after finishing

hazy pendant
#

tuple time

sinful pawn
#

er... frankly I dunno if it's possible to explain that line more simply

woven sable
#

Oh no, I was trying to solve 2015'sDay 5

#

Not 2021

sinful pawn
#

._.

earnest forge
#

I got 10 points today :)

earnest forge
hoary canyon
#

The gride should be of 9X9?

pine tiger
#

8 mins today

#

is that good

quaint hare
#

file load is screwing my mind

earnest forge
#

My guess is that it's around 1k

hazy pendant
#

wait

#

this isn't using math inbetween stuff

#

omly integers

quaint hare
#

yeah

hazy pendant
#

hhhhhhhhhh

earnest forge
#

Yeah no this problem is nice to us :)

hazy pendant
#

imagine if it showed a desmos graph

earnest forge
#

πŸ™ƒ

hazy pendant
#

||breshenham||

hollow wharf
#

you definitely don't need that algorithm

left path
#

||y=mx+b||

earnest forge
#

Also no

signal grotto
#

going slow again today to make pretty code

sonic silo
#

this puzzle is funny

velvet cape
#

I'm just curious about how fast do you have to solve aoc problems to be in the first 100

signal grotto
#

usually a couple minutes

void ocean
#

Someone willing to give me their input and output?

hollow wharf
#

sure, one sec

#

test cases are unique?

void ocean
#

nah we all have different input/output

hollow wharf
#

yeah, or at least there are pools of testcases and we probably have different ones

#

oh

#

If you have the same inputs do tell lemon_glass

naive stone
#

man, i really don't see how my code could be wrong

earnest forge
naive stone
#

i can't imagine i'm missing some edge case, it's a straight forward problem

hollow wharf
#

those answers were accepted discre3Hmm

void ocean
#

i'm off by 3

hollow wharf
#

fisk, ||are you filtering out lines that are not straight?||

earnest forge
void ocean
#

|| 5832 ||

earnest forge
naive stone
earnest forge
#

Are you ||forgetting to include the ends of the lines|| or something?

hollow wharf
#

hmm lirikHMM

#

oh yeah, what hex said

#

I think I was doing that for some at one point

naive stone
void ocean
#

Don't judge the repetitiveness copilot did all that grunt work lol

naive stone
#

i love these insane moments where my code seems flawless and yet i get the wrong answer

earnest forge
void ocean
#

yeah but there are no spoilers there

#

i can't unsee other people's code

earnest forge
#

I meant fisk but yeah I see your point

outer chasm
#

Ok I don't care about the leaderboard anymore

candid berry
void ocean
#

I'm not done yet

candid berry
#

πŸ‘Ή

#

srsly, this channel is supposed to be spoiler-free

sullen ruin
#

Day6 is gonna be ||find the shortest path through the field of vents|| I'm calling it πŸ˜„

earnest forge
#

sus

void ocean
#

@hollow wharf How many 1's did you get?

hollow wharf
void ocean
#

p1

hollow wharf
#

||95878 exact 1's||

void ocean
#

smh i have a few hundred less

#

thousand actually

#

hm

junior hinge
#

morning people πŸ˜„

mystic plover
#

if two lines form an L shape do they overlap?

hidden musk
#

the ranges are end inclusive

void ocean
mystic plover
#

right

#

hm where am i going wrong

onyx plank
#

I have a numpy question: is there any effective way to modify all the elements between two points that isn't a bunch of if and for statements? I solved part 1 but I kinda wanna see if I can clean it up a bit for part 2

void ocean
#

not including diagonals?

onyx plank
#

i mean, ideally including diagonals but i'd be fine without it

#

I know how i can do it with a bunch of if and for loops but i feel like there's gotta be an easier way to do it

muted pivot
#

.aoc leaderboard JustAnAverageGuy

hidden copperBOT
#

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

woven oriole
#

:D

#

but after seeing part 2

#

πŸ›Œ

#

my runtime is fucked

#

lemme fix

violet raft
#

took my pc 3 min to get the answer to part 1 lol, but it worked

hollow wharf
#

Hello, I don't understand what I need to do in my challenge. Should I ask here or somewhere else?

mystic plover
#

bruh im so confused why does my code give me the wrong answer

#

it seems so correct

cursive temple
jade atlas
mystic plover
#

πŸ™

#

it worked

#

thanks

#

lol

jade atlas
junior hinge
#

do you put all the x1s x2s and y1s and y2s into theyre own lists? im not quiet understanding how to tackle this problem

woven oriole
#

thats why the runtime is fucked

#

i prolly need a clever wayy which does not include numpy

#

lmao

jade atlas
#

hint: ||you do not need any matrix for this problem||

#

there is a subreddit too.. you can get the link in the website

sinful pawn
#

idk if that spoiler really spoils anything tbh

outer chasm
tight dune
marsh currentBOT
#

:incoming_envelope: :ok_hand: applied mute to @stable heron until <t:1638687022:f> (9 minutes and 59 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).

woven sable
#

ohh

#

are you asking what the challenge is?

#

wait I think that goes there, not sure

hollow wharf
eternal trail
#

Same, but with diagonals πŸ˜†

mystic plover
#

guys i did it!!

stable heron
#

:(

#

i started two hours late

#

:(

sinful pawn
#

I started a day and 2 hours late

woven oriole
dusk ibex
#

hey I am having a problem with a lot of stuff, the input is weird

#

it shows 491 as that

#

idk why it is tho

deep quartz
#

help me

sinful pawn
dusk ibex
sinful pawn
#

How are you "using" a file

dusk ibex
sinful pawn
#

um...

sinful pawn
dusk ibex
#

it gives me a value error

sinful pawn
#

well... you can't really convert a tuple to an int

#

it just doesn't make sense

dusk ibex
#

oh now it works

dusk ibex
sinful pawn
# dusk ibex

This looks like something you'd see in an editor and you're using the wrong encoding

dusk ibex
#

and it worked

#

the only difference is i created it using manuvally

#

instead of using echo

#

maybe that's something idk

sinful pawn
#

unless...

#

no I was pretty much right

dusk ibex
sinful pawn
dusk ibex
#

I am converting string to int

sinful pawn
#

no you're converting a list of a split string to an int

dusk ibex
#

and I am still doing it

#

look at the code

sinful pawn
#

oh.

#

you're confusing the heck out of me

dusk ibex
#

xd

sinful pawn
dusk ibex
#

i mean the wrong thing wasn't the code

#

it works

#

well I printed it when I have a value error

#

I printed the start_pos[0]

sinful pawn
#

umm

dusk ibex
#

and it printed that instead of 49

#

1

#

now it is fixed

#

idk why

#

I did not change the code

violet raft
#

im crossing my fingers that after waiting 5 min for part 2, my sol would be correct

#

yay, it's correct

hollow wharf
#

my solution is so slow ugh

#

it's taking like 200ms

#

should be max 50ms

young oriole
#

Got part 1 no problem, got part 2 correct for the test case, but my answer keeps coming in to low. 😭

young oriole
hazy pendant
#

LMAOOOO

#

I ||COPIED BRESENHAM|| FROM WIKIPEDIA FOR PART1

#

ADDED AN IF CONDITION

#

REMOVED THE IF CONDITION

#

AND IT WORKS FOR PART2

young oriole
# dusk ibex same

I tried someone elses puzzle input, and compared it to their answer. I am still a few off from theirs but not by much. Now to figure out why its causing the issue.

dusk ibex
#

for the example input I get 11 which is one away

#

which means maybe we both have the same issue but gl! Imma read second part more

modern oracle
#

(RE Part 2) Can someone please explain why position (0, 0) is a 1 and not 2 for linespy """ 8,0 -> 0,8 9,4 -> 3,4 2,2 -> 2,1 7,0 -> 7,4 6,4 -> 2,0 0,9 -> 2,9 3,4 -> 1,4 0,0 -> 8,8 5,5 -> 8,2"""Surely it should be 2 because 8, 0 -> 0, 8 and 0, 0 -> 8,8 would both include 0,0

young oriole
#

Thats why I was frustrated. I got the example right. I added the difference I got from my solution and their answer and added it to my puzzle input and got it right. Which is weird, because my puzzle answer is several thousand higher then theirs. On their problem I was only 27 off. Thought i'd see what happend, and lo and behold it was correct.

mossy basin
modern oracle
#

hmm

#

That makes sense

#

Added (0, 0) for (8, 0) -> (0, 8)
Guess my code is just broken then lol

stable heron
#

OH MY FUCKING GOD.

#

OH MY GOD

#

I WAS COUNTING FUCKING DIAGONALS FOR PART ONE

#

AND IM WONDERING WHY IT WASNT FUCKING WORKING

#

OH GOD

sonic silo
#

wao

dusk ibex
modern oracle
celest moth
#

Stuck on Day 3, Part 2, getting value too high

#

Any tips? Thanks

sinful pawn
#

that is a quite suspicious looking link

hazy pendant
#

can't wait for quantum computers to come out and AoC speaking RSA

rancid creek
sinful pawn
#

When in doubt, test on the sample input and print every step of the process

honest bay
#

hello, I'm a beginner in Python and creating a hangman program. Say I have random word which is 'bear', which in turn will look like '---- '. My question is, how do I put the input from user to its specific index? like if the user input is 'r' which then prints as follows: '--- r'. Thanks!

sinful pawn
#

Oh yes. Hangman

hazy pendant
#
  1. hm, isn't this not #advent-of-code
  2. you can turn a string into a list of characters, and you can turn a list of characters into a string.
    normal indexing would not work since you have >1 indexes, so you'd have to iterate over the list and turn stuff on/off to get what you want.
devout tusk
#

did y'all ||store the array of points or compute it mathematically?||

craggy wraith
#

i just got to part 2 my head hurts

hazy pendant
# hazy pendant 1. hm, isn't this not <#897932085766004786> 2. you can turn a string into a lis...
# undestand this please

# list comprehension - string -> list of bytes
str = "bear"
strlist = [c for c in str]

# make a list of 0s with the length of the string
switches = [0] * len(strlist)

# iteration for input stuff
def inputChar(c):
    global switches # global vars
    switchedAnything = False # hangman
    for i in range(len(strlist)): # iterate i as an index from 0 to len(strlist)-1
        if strlist[i] == c: # :)
            switches[i] = 1 # if matched, then show a character
            switchedAnything = True
    return switchedAnything

def show(switches, strlist):
    for i in range(len(strlist)):
        # check if a char is "switched" or not
        if switches[i] == 0:
            print("-",end="") # print with the end of "", normally this will end in newline, but we'll change it to empty instead.
        else:
            print(strlist[i],end="")
    print() # finally, a newline
honest bay
#

sorry for using the wrong channel

bright haven
#

this channel should be about Advent of Code, right?

tight dune
#

im not sure if this is related, but there appears to be a rust kernel for jupyter
any idea why it's so damn slow (running it on wsl)

#

id like to use it for aoc

rapid wolf
#

I am assuming it has to somehow compile every cell

#

which can't possibly be fast

hidden musk
#

unless? 😳 interpreted rust? 😳

sonic silo
#

lol

#

even the C/C++ kernel felt slow

junior hinge
#

wooho

pliant comet
#

good job!

bleak sable
#

I still have yesterday to make... But i read the yesterday's task when going to bed and I think I have solution that will be relatively short without using numpy like @frigid zephyr suggested ;P

frigid zephyr
#

Nice

bleak sable
#

My partner was like "you don't have to care about complexity, you can just do it so-and-so", and I was like "I know, but I like doing it in few lines without explicit loops (implicit like comprehensions are fine, I just hate nesting)" :D

low condor
#

Done day 5 p1 and p2. Today felt much easier than yesterday but my code is super inelegant

frigid zephyr
#

I haven’t had a look at today’s puzzles yet

bleak sable
#

Me neither. And I don't remember what my github password is (lol), so I'm not coding anything on my phone XD

low condor
#

I do like to look at puzzle on my phone, even if I wont' get around to it for a while

bleak sable
#

Probably if I knew what github's password requirements were, then I'd know what my password was

low condor
#

means my brain can crunch on it in the meantime

bleak sable
#

Because I remember that I had a realisation last time I reset it

low condor
#

This is off-topic, but it's thanks to GitHub that I avoided having my other accounts hacked

#

because my previous password that I used everywhere had been leaked

#

but GitHub runs all passwords through Have I Been Pwned

#

and warned me that the password had been leaked and that it was a good idea for me to change my passwords ASAP and use a new one on GitHub

hidden musk
#

use a password manager πŸ˜”

low condor
#

Now I do!

#

I use 1Password now

bleak sable
#

I've been using lastpass but they changed their free tier and you can either use it for mobile or for desktop, not both :c

#

And I remember some passwords anyway - they're not entirely random, just long af.

iron shadow
low condor
timber glacier
#

did anyone use vectors

rancid mural
#

i used way too much nesting

iron shadow
hidden musk
timber glacier
#

not sure how to use vectors in python

#

numpy?

hidden musk
#

yes

tight dune
#

people use numpy?

#

why? normal python is fast enough imo

sonic silo
#

numpy has much more powerful and concise operations, making it very good for treating with AoC puzzles

hidden musk
#

it's not always about speed

tight dune
#

oh

#

i dont know enough about numpy to use it at speed

#

maybe ill use it next year

hidden musk
#

that's what learning is for!

sonic silo
#

tbf

#

i half-learnt numpy last year as a last resort for y2020d20

hidden musk
#

the sea monster πŸ˜”

sonic silo
#

yeah

tight dune
#

i discovered using jupyter nbs for advent of code yesterday

woven oriole
#

day 2 of me being at #69 streak

tight dune
hidden musk
#

eh?

woven oriole
#

eh to whom

hidden musk
#

u

woven oriole
hidden musk
#

ah

woven oriole
#

48 hours straight streak

tight dune
#

yesterday trashed my score

#

i will have to work up the speed

#

to compensate

woven oriole
#

and I think school will trash my score

#

😩

tight dune
woven oriole
#

same

tight dune
#

but i cant skip weekends (they r important) so tht trashed my score

sonic silo
#

ive ended up sleeping 20 mins over the beginning of the last two days' puzzles

#

its sad cause like

woven oriole
sonic silo
#

today i got the puzzle under 20 mins

#

(from the time i actually got to my computer of course)

woven oriole
#

since it covers both school level and high

tight dune
#

i normally take like 30 minutes because i like to go slow and set up classes etc

#

be sure that itll work on first pass

woven oriole
#

So I usually don't go

tight dune
#

ngl advent of code is very fun

#

me likey

woven oriole
tight dune
#

nvm not related to aoc

woven oriole
short lava
#

Solved day 4 part 1 and am too lazy to modify my solution for part 2

woven oriole
#

Take nap grind backℒ️

loud yew
#

DONEEEE FINALY

humble copper
#

i have zero idea what im doing at this point lmao

loud locust
woven oriole
ancient gale
#
sad = 0
while true:
    sad += 1
    if sad > 10:
        break
    if sad == 5:
        continue
print(sad) ```
#

what's wrong here

low condor
#

or titlecased, rather

hidden musk
#

probably nameerror right

low condor
#

True

#

oh maybe lol

hidden musk
#

but yeah, should be True

low condor
#

Yeah, NameError

ancient gale
#

Thanks

jade atlas
#

how many people do you guys predict will finish 50 stars before January?

digital ember
#

~70

#

looking at #aoc-bot-commands message

regal garnet
#

I struggled for 20 mins, turns out I had messed the regex up lemon_angrysad

low condor
#

Insert Jamie Zawinski regex quote here πŸ™‚

#

Some people, when confronted with a problem, think β€œI know, I'll use regular expressions.” Now they have two problems.

regal garnet
#

feels bad man

#

haha

sleek cave
pallid stirrup
#

hey, don't want anyone to reveal solutions to me (still working on the problem, woke up late lol), but the input has this line: 609,916 -> 60,367 which doesn't seem to make sense because neither of the coordinates stay the same, and i don't have a given way to round points to grid numbers
is there something i'm missing here

minor cave
sleek cave
#

ah yes, when you try to define a parse_input function but writes the human posterior instead

sonic silo
#

yes

#

thats how it realyl feels

loud yew
primal vapor
#

me 2

sleek cave
sonic silo
#

but then noticed

#

"haha no diagonals tho"

primal vapor
dusk ibex
#

hey can I have some help me understand how diagonals work in this one?

#

for example: what are the points inside (0, 1) -> (1, 3)

peak dock
#

you're guaranteed that there won't be diagonals like this, all diagonal lines will be inclined at 45 degrees

#

if it was (0, 1) -> (2, 3) it would be [(0, 1), (1, 2), (2, 3)]

dusk ibex
#

oh! wow

#

damn I am stupid! thank you for helping

#

@peak dock

peak dock
#

πŸ‘

dusk ibex
#

@peak dock πŸ‘

peak dock
#

nice

dusk ibex
#

:D

junior hinge
#

back

#

im stuck on part 2 from today :/ the logic on how do you know if its a potential diagonal line

humble copper
#

well something went wrong

minor cave
#

||45 degree lines will always have a slope of 1 or -1, that's how I approached it||

humble copper
#

wait was that a spoiler

#

oops

humble copper
#

are we allowed to segment our code into multiple programs to prevent memory issues

#

or must the solution be able to run in a single file

minor cave
humble copper
#

oh ok

hidden musk
#

that's a lot of memory, do you have a huge array or something

craggy wraith
#

diagonal lines (╯‡░′)╯︡┻━┻

humble copper
#

now im using half of that but its more stable

#

and now i understand why 64 bit is preferred over 32 bit

warm grail
junior hinge
loud yew
#

for my solution i basicaly just generated a list of all points in all lines and then counted the number of occurences of the same point using a dict

hidden musk
#

those are the only kinds of lines

junior hinge
#

i used a defaultdict

warm grail
#

and I got the answer
so yes I guess

junior hinge
loud yew
junior hinge
hollow wharf
#

or slope of 0 or infinity (horizontal and vertical) so one way to do it is ||have a dx and dy that increment from point 1 to point 2, dx and dy can be 1, 0, or -1||

loud yew
hollow wharf
#

that works too, but you can cover straight lines too with 0

pallid stirrup
#

pretty much got my solution working but it's being really slow fsr
using ||points = set(point for point in points if points.count(point) > 1)|| to get intersections and it's taking forever on the actual input because of how many points there are
is there a better way to do this?

hollow wharf
#

what is your points object?

pallid stirrup
#

list of tuples (so smth like [(0, 0), (4, 5)...)

junior hinge
#

are these correct? im thinking about diagonals = ||5,5 -> 8,2 = (5,5), (6,4), (7,3), (8,2)||

loud yew
hollow wharf
#

your slowness is coming from doing points.count so many times

loud yew
hollow wharf
#

well a dict rather than a list to count them from the start is a good approach

craggy wraith
#

(β•―Β°β–‘Β°οΌ‰β•―οΈ΅ ┻━┻

loud yew
#

oops spoiler was broken
sorry anyone who saw that and dint want a spoiler

peak dock
pallid stirrup
#

@hollow wharf thanks, it works nearly instantaneously now lol

sleek cave
#

day 5 is so much FUN

#

why is this so FUN

#

i feel like a little child rapidly opening christmas presents with impatience every single day when i wake up and go straight to my phone for the latest puzzle

bleak sable
sleek cave
#

lmao yeah

#

i mean, my solutions aren't all efficient, but this is so FUN

sonic silo
#

ngl

#

today really felt fun

#

as well as the third day

native crystal
#

where is the problems?

hollow wharf
native crystal
#

how can I participate?

hollow wharf
humble copper
#

I DID IT

craggy wraith
#

same

#

finally

#

my code is like 84 lines long lol

copper totem
#

in day 3 the most common hast to go from each line ?

#

like on [0] is lets say most common 0 so for [0] its 0 ?

#

or does it go in row

rancid creek
copper totem
#

nvm

#

i figured it ou

#

t

#

i got the star

junior hinge
#

finally :OOOO i had a typo i didnt see :XXXXX

#

:DDDDDDDDD

#

i and 1 look so similar with my eyes. i should consider incrementing the font size in VSCode πŸ˜“

fathom lichen
#

So... this is the first time I'm participating in something like this and it's really helping me learn some things. Does anyone know of similar activities throughout the year, or is it just this one in December?

small storm
#

Suggest a program that generates an integer included in the interval 0; 10 (do not use another random number generator (randint ...)

#

help me pls i am a amateur

signal grotto
signal grotto
low condor
rancid creek
low condor
rancid creek
#

unless it involves sea monsters, we don't discuss sea monsters. πŸ™‚

#

πŸ¦‘

sleek cave
hidden musk
#

cry

sleek cave
#

understood, have a nice day

sinful pawn
sleek cave
sinful pawn
#

oh

#

it's not https

sleek cave
sinful pawn
#

ikr

low condor
left path
#

for part 2 you'll actually have to assemble the whole image

low condor
#

I actually assembled the whole image for part 1

#

that trick completely went over my head

left path
#

yeah same i only learned about finding the corners after i solved it and checked the chat here

low condor
#

so, in a way, I was happy part 2 relied on that

#

I would have felt like the biggest idiot ever if you didn't have to assemble the pic

hidden musk
#

i predicted i'd need the whole image

#

yeah lol, same with today's, i knew we ||were gonna need the diags||

low condor
#

I actually didn't mind 2020.20 . It wasn't difficult, it was just a slog

#

a lot of legwork involved in assembling the picture and then finding the monster

sleek cave
low condor
#

that one lol

sleek cave
#

how does that have to do with sea monsters

low condor
#

you had tiles that made up the picture

sleek cave
#

at least i think part 1 doesn't

low condor
#

well, yeah, I did part 2 in part 1

merry flax
#

Day 5 Maybe I'm not understanding the problem right.. for every point that has had 2 or more intersections.. this counts towards the total

sleek cave
low condor
#

they had sea monsters in the picture

sleek cave
#

oh lmao, that's so cool

low condor
#

the searching for the sea monster was the easy part

#

it's the tile assembly that was a pain

#

rotating and flipping tiles and trying to find edges that matched

#

I'm just lucky there were no situations where an edge could match with more than one other edge

#

if that had been the case I would have been so screwed

tight dune
#

@low condor i just got your name's pun xD

low condor
#

I couldn't think up a Xmas themed one like everyone else

#

so I went with Harry Potter instead

#

Also no-one got Fiddle on the Roof, which is sad

hidden musk
#

great musical

#

no one got my prescription drug addiction joke, that was even sadder

hollow wharf
#

perfect start to day 4

sharp panther
#

sir wut

sinful pawn
hollow wharf
#

fuckin numpy wont import

woven sable
rancid creek
tall garden
#

|||||

hazy pendant
narrow crown
woven oriole
#

thats atom editor default one dark ig

brazen goblet
#

hey guys, just curious, for day 3 part 2, do we have to do the equally common stuff? there wasn't any equally common for part 1 and we're using the same input

mossy basin
#
import networkx as np, numpy as pd, pandas as nx
hazy pendant
#

oh no

#

menacing

woven sable
#

7 minutes! Who's staying up? πŸ™‹

#

Well actually, some of you all might not be staying up haha

peak dock
#

i am indeed staying up at 10:23 am

woven sable
#

ah yes, an all nighter

peak dock
#

yeah, its pretty hard

woven sable
#

i wonder if playing music helps with solving AOC hm

signal grotto
#

all-morning-er

woven sable
dense solstice
#

You've been coding without music?

#

Diff

woven sable
dense solstice
#

Ah, I get in the zone when I listen to music, diff for everyone

#

Just setup fira code for ligatures so my eyes be pleased by my code

#

Although alacritty doesn't support ligatures, had to setup temp kitty terminal

woven sable
dense solstice
#

Crying

woven sable
#

I should just play a lowkey but upbeat song, I think that'll help

dense solstice
#

Lofi βœ”οΈ

woven sable
#

see, when I listen to lofi, i zone out lol

dense solstice
#

You must be listening to some weird lofi

woven sable
#

it's just too background-y

dense solstice
#

That's the point

woven sable
#

I need something that's more prominent

mossy basin
#

i don't like background music

prisma sundial
#

another day another aoc challenge

#

who's pumped

mossy basin
#

find it distracting

dense solstice
#

Guess I'm the odd one out

woven sable
#

i'll not play music for P1 but play it for P2, I wonder if that'll help

#

an experiment

prisma sundial
#

playing music during AOC is impossible

woven oriole
#

i have experimented

dense solstice
#

πŸ‘οΈ πŸ‘„ πŸ‘οΈ

woven oriole
#

some swiftie songs

dense solstice
#

Why does fira code look kinda puffy

#

Nvm prob my font size

woven sable
signal grotto
#

ok now for real tonight if it's too difficult i'm saving it till tomorrow πŸ˜‚

woven sable
#

that's the perfect song

#

it's lowkey yet prominent

dense solstice
#

If it's to hard fuck it we doing all nighter

sonic silo
#

πŸ€”

woven sable
#

I have school tomorrow but I guess I'll ruin my sleep schedule

hazy pendant
#

lofi

dense solstice
#

Can't ruin a ruined sleep schedule

hazy pendant
#

30s left

woven sable
#

lol true

hazy pendant
#

menacing

woven sable
#

I've had too much caffeine today

woven oriole
#

why do i see red πŸ‘€

woven sable
#

so I'm staying up :P

#

time to close disc

woven oriole
#

gl

woven sable
#

cya when i'm done with P1

pearl needle
#

time to take 10 minutes parsing again

hidden copperBOT
sinful pawn
#

oops

#

not again

hazy pendant
#

recursion

#

recursion

#

the recursion