#advent-of-code

1 messages Β· Page 38 of 1

wary wigeon
#

hey

hidden musk
#

your pride

warm berry
#

I'm just glad I got my 2 stars, I have a feeling my effort will drop off as this goes on

last egret
#

like day 4 yea; as the mathiness ramps up quick

mossy basin
#

Day 1 visual, ocean floor is generated from input.

minor cave
hazy pendant
mossy basin
#

this was a fun one to make

warm berry
mossy basin
#

i need some christmas lights for the sub though 😦

earnest forge
stiff kraken
warm berry
hidden copperBOT
#
I can't believe you've done this

Your input was invalid: Cannot convert #547603986 to a recognizable Hex format. Hex values must be hexadecimal and take the form #RRGGBB or #RGB.

Usage:```
.colour hex <hex_code>

minor cave
#

!e print(hex(412547603986)[2:])

marsh currentBOT
#

@minor cave :white_check_mark: Your eval job has completed with return code 0.

600dc0de12
mossy basin
#

bood coder?

earnest forge
#

I should probably come up with a new nickname for this year

minor cave
#

ha, good coder. cute.

earnest forge
mossy basin
#

i know, i see it, you bood boi

bright spindle
mossy basin
#

i just occurred to me that my parallax widget supports vertical offsets

sonic silo
earnest forge
#

So when do we get aoc: the game @mossy basin

sonic silo
#

thats 2019

earnest forge
#

True

mossy basin
#

that's true

earnest forge
#

Btw does anyone know confusedreptile's time zone?

stiff kraken
#

hey salt, how long did it take you to get this skilled at making graphics in a terminal, starting from scratch?

#

since pretty much anyone is just amazed by your skills

hidden musk
winged trellis
mossy basin
#

i dunno, like two years i guess

stiff kraken
#

damn, that's amazing

#

i've been doing python for like...3 years i guess?

#

and even then i'm still amazed by this

earnest forge
hollow wharf
winged trellis
#

or never stop being cool πŸ˜„

warm berry
winged trellis
#

well, mine is just myself πŸ˜„

warm berry
stiff kraken
winged trellis
warm berry
#

I clearly leveraged some super skills for my santa hat

hollow wharf
winged trellis
#

there we are

#

thanks @minor cave

warm berry
#

Literally perfection

stiff kraken
#

haha that's top notch

mossy basin
#

lol

#

now i need a hat for my die

main violet
#

how the heck did you do that up there

stiff kraken
main violet
#

yep

stiff kraken
#

salt is godlike and made his own library for these things

main violet
#

he should have a promotion

#

in roles

stiff kraken
#

as far as i'm aware, helper is mostly based of python skills and ability to teach others. The next step up is moderator which means you also need to be fit for moderator duties

terse comet
#

the roles are not directly tied to your level of proficiency (though there is a minimum skill level we'd expect, but even then it is not the only factor)

mossy basin
#

-1 on salt mod

stiff kraken
#

and between just helping others and actually moderating is quite a difference for people unexperienced

warm berry
#

plus1 @salt-die for Terminal Graphics Lead

terse comet
#

being a moderator sometimes is more than just swinging a hammer around, ye'know?

nocturne blaze
bright spindle
#

I'd say the most important criteria are culture fit and how dedicated you are to contributing to the community, either through helping, contributing to our code repos, events organization, creating art or other assets, etc.

terse comet
#

(you mean that mostly for Helper, not Moderator/Admin, right?)

stiff kraken
terse comet
stiff kraken
bright spindle
#

Yes, although mod and admin are basically just different ways of contributing to the quality of the community.

bronze vault
#

Does anyone have a good system to organize all of this aoc code? You guys putting part 1 and part 2 into functions?

stiff kraken
#

and inside those the code and input files

mossy basin
#

i do something similarish

digital ember
bronze vault
#

Gotcha. Yes that's probably a good idea

mossy basin
#

except i don't have folders for days

stiff kraken
mossy basin
#

all my inputs are in a single json

bright spindle
#

I usually create a new repo for each year/language combination.

stiff kraken
#

it's my first year so eh

bright spindle
#

And a separate directory per day

digital ember
#

That's waht I did for my rust template, single json file containing the inputs

minor cave
zenith fern
#

i should probably make a github repo for my solutions

bright spindle
digital ember
#

i having different branches for different languages (rs/py) rn

stiff kraken
digital ember
#

will probably shift to a separate repo

sonic silo
#

i like to solve puzzles this way

bronze vault
#

do you keep the inputs for each day?

sonic silo
#

cache'd, yea

regal gazelle
#

How can I play it?

summer kraken
#

I just create directory as year/day/ and problem number.

#

Like year/day/1.py

regal gazelle
sonic silo
#

in the webpage you jsut post the solution for the puzzles

bronze vault
#

Is the input for both parts the same?

sonic silo
#

you can get the answers to the puzzles however you want

sonic silo
stiff kraken
# regal gazelle How can I play it?

you join AOC by going to the webpage, reading the question, and giving the answer. This often involves writing a short program to solve it for you

blazing imp
#

is it still going ?

stiff kraken
#

today is day 1

#

it ends on christmas (day 25)

#

although you are free to do the questions any day

#

you can still look back at 2015 if yo uwant

summer kraken
#

Is it possible that someone does not write the program, but solves the question manally?

blazing imp
#

where are qus ? i am new to this

minor cave
stiff kraken
#

but some questions can be more easily solved by hand

summer kraken
#

Hmmm... I see.

stiff kraken
#

today's dataset is 2000 numbers

summer kraken
#

I don't mean to do them manually, was just asking.

stiff kraken
#

keep in mind, everyone has a different dataset to stop cheaters

summer kraken
#

But- the same code will work.

junior hinge
#

anyone wanna review my code for day1? I did it in a hurry this morning before running to work πŸ˜“

tepid cairn
#

Hi :D

#

Aoc has started

#

I shall do the problem when I get home

stiff kraken
summer kraken
#

And why are different shapes made each year?
In 2015 it was a Christmas tree.

This year it is a ||I can't tell. Sorry||

sonic silo
#

lore reasons

#

the puzzles do be havin lore

#

2016 had a business building since thats where the puzzles took place

#

2019 had a solar system cause we were literally navigating in space

summer kraken
#

Can I tell what's it for 2021?

mossy basin
#

2017 was like a circuit board or something

sonic silo
#

yep

#

it was

summer kraken
tepid cairn
#

Do the problems get harder each day?

summer kraken
#

Yea... I suppose

stiff kraken
#

afaik yes

regal gazelle
#

Guys can You help?

topaz summit
tepid cairn
#

Oop

stiff kraken
#

i guess you can look at previous years to see how it changes

tepid cairn
#

Perhaps

normal pendant
hidden musk
#

last year it was like a map

north swallow
#

What are we creating in this?

#

Can we Share self created modules

#

Or anything else

stiff kraken
#

you are trying to answer small questions

#

and maybe you'll even learn something new

north swallow
#

Okay

stiff kraken
#

your approach may be in any way, but just don't cheat

north swallow
#

Okay

#

That sounds cool

normal umbra
#

Hello. Can someone explain me what I have to do in day 1 part 2 problem? I read it like 3 times, and still don't understand πŸ˜› .PS : Don't give me solution or hint. Just need explanation of the problem

north swallow
#

Where's the questions

velvet stag
#

when you have 5 things
12345
you have 3 windows of 3
123
234
345

#

always nβˆ’2 windows

#

find the total for each window

normal umbra
#

Oh I see

#

Hmm alright let me try it out now

#

Thanks

#

Thanks @velvet stag I solved day 1 completely!

regal gazelle
#

can someone help me please :(

#

I my gues was wrong

#

1764

#
import os
os.chdir(os.path.dirname(os.path.abspath(__file__)))
def getIncreases():
    file = open("num.txt", "r")
    lines = file.readlines()
    counter = 0
    lineCounter = -1
    for line in lines:
        lineCounter += 1
        if lineCounter == len(lines) - 1:
            lineCounter -= 1
        if lines[lineCounter] < lines[lineCounter + 1]:
            counter += 1
    return counter

print(getIncreases())```
sage bronze
#

... inputs are session-bound, by the way

regal gazelle
sage bronze
#

we won't see what input you have

#

only what we have

normal umbra
#

everyone has a different input

sage bronze
#

that's not the point, though, really

regal gazelle
#

but what is wrong with my code?

winged trellis
regal gazelle
#

takes the numbers from my input file and checks if they increase

normal umbra
#

your code doesnt seem to do that

winged trellis
regal gazelle
#

yeah

mossy basin
winged trellis
#

right.. lets do that @regal gazelle

#

@junior hinge did you not join the leaderboard?

junior hinge
#

I did πŸ™‚

winged trellis
#

oh anonymous user

junior hinge
#

for some reason I chose anonymous when creating AoC earlier a few weeks back

#

im debating with myself if im gonna be on 06:00 tommorow or not πŸ˜„

winged trellis
#

i think you can change that in settings

#

yeah you can

junior hinge
#

yeah im there now. i used google oauth so it has a fake name ;D

winged trellis
#

nice πŸ˜„

junior hinge
#

i prefer the anonymous user tbh! im probably gonna fail on day 2 anyways xD

winged trellis
#

its not a competition among us, its a competition with yourself

junior hinge
#

i was just lucky i was up at 06:00 am today. my stomach went into super crazy mode at 4am so i was not able to sleep anymore πŸ˜“

winged trellis
#

most people do 1-2 days

#

there is a huge falloff around the one week mark

junior hinge
#

yeah i know. its a good challenge for me and my self! ive allways been afraid of failing

winged trellis
#

failure is the best teacher of all

junior hinge
west summit
#

you dont have to do challenge each day? like if you miss one , you can do it another day ?

winged trellis
#

i still have two left from last year

#

so i might do them this year maybe πŸ˜„

junior hinge
#

are there any prizes for the leaderboards btw?

hollow wharf
#

stars

winged trellis
minor cave
#

Putting in a prize brings out the worst in some people and unnecessary cheating increases and kind of ruins it

junior hinge
#

okay i get so satisfied by ascii stars anyways. its making my heart feel warm and cosey

minor cave
#

Although maybe we have a fun temp role for january that's essentially "I finished every AoC puzzle for this [past] year"

sonic silo
#

roles are silly

winged trellis
minor cave
#

I mean, this would have a ✨ role icon ✨

winged trellis
#

i do like my role icon tbh πŸ˜„

minor cave
#

I'm still so proud of how those turned out

digital ember
#

✨ colour ✨

hollow wharf
#

.aoc join

dusk pagoda
#

.aoc join

mint hornet
#

.aoc join

loud yew
#

.aoc join

zenith fern
#

.aoc join

mint hornet
#

How's the challenge going for everyone else?

sonic silo
#

great

hollow oyster
sonic silo
#

i already see ive become so much faster compared to the previous year - altho its just the first day lol

loud yew
#

this is the first time ive done it, its been fun so far

hollow wharf
#

.aoc join

hollow oyster
#

I have been doing python for about 9 months I guess, and that question is fricking confusing

minor cave
hollow oyster
#

I was able to think in some way to what I should do but that's it

normal umbra
#

Ok so in order to get more points, I have to solve the puzzle faster than others right? Like right as it releases?

minor cave
#

yup!

normal umbra
#

Hmm

#

I'll have to wake up early

#

eh maybe I wont be going for most points this year. Exams are more important lol

#

also, whats this supposed to be?

#

saw this on the calendar page of 2020

#

is it just some ascii art?

mint hornet
sonic silo
normal umbra
#

Oh

sonic silo
#

that year we were goin on a trip to the sandy beaches of hawaii

normal umbra
#

Yeah I remember!

#

under the sea this year then? lol

graceful mesa
#

will i get star if i solve this question tomorrow

minor cave
normal umbra
#

Ah

loud yew
#

if you don't do a puzzle one day, can you do that puzzle the next day?

sonic silo
#

yes

minor cave
mint hornet
#

what does the swiggly lines in calender mean?

sonic silo
#

its a drawing

minor cave
sonic silo
#

as days pass, you will see a full drawing

minor cave
#

Each day you complete will reveal more of the drawing and in color

mint hornet
#

Wow, that sounds beautiful.

#

thanks for the info

brazen cape
#

im a beginner on python and i got through day 1, im actually so happy lol

#

may I share the result for recommendations on how I could've done it better? or is that against the rules

brazen cape
#

thanks! πŸ™‚

craggy wraith
#

I bet someone is going to try to solve all the problems in a one liner

coarse wagon
#

I am planning to solving these in multiple langs, just to get some proper training in them all

#

I guess I could throw one line python into the mix xD

idle glen
#

.aoc join

fierce comet
#

hello, i don't understand the second step in the first day of aoc, in the sense that i don't quite understand the term "three-measurement sliding window", like does it go like this: ```

199 A
200 A B
208 A B C
210 B C D
200 E C D
207 E F D
240 E F G
269 F G H
260 G H
263 H
.
.
.
.
243 Y Z A
345 A Z B
342 A B C

#

or in some other way?

summer wave
#

.aoc

hidden copperBOT
#
Command Help

**```
.adventofcode

**Can also use:** `aoc`

*All of the Advent of Code commands.*

**Subcommands:**
**`about `**
*Learn about Advent of Code*
**`countdown `**
*Return time left until next day*
**`join `**
*Learn how to join the leaderboard (via DM)*
**`subscribe `**
*Notifications for new days*
**`unsubscribe `**
*Notifications for new days*
summer wave
#

whats the challenge again

#

.aoc about

hidden copperBOT
#
What is Advent of Code?

Advent of Code (AoC) is a series of small programming puzzles for a variety of skill levels, run every year during the month of December.

They are self-contained and are just as appropriate for an expert who wants to stay sharp as they are for a beginner who is just learning to code. Each puzzle calls upon different skills and has two parts that build on a theme.

How do I sign up?

Sign up with one of these services:

Auth Services

GitHub
Google
Twitter
Reddit

How does scoring work?

For the global leaderboard, the first person to get a star first gets 100 points, the second person gets 99 points, and so on down to 1 point at 100th place.

For private leaderboards, the first person to get a star gets N points, where N is the number of people on the leaderboard. The second person to get the star gets N-1 points and so on and so forth.

Join our private leaderboard!

Come join the Python Discord private leaderboard and compete against other people in the community! Get the join code using .aoc join and visit the private leaderboard page to join our leaderboard.

summer wave
#

.aoc join

hollow wharf
mint hornet
# fierce comet hello, i don't understand the second step in the first day of aoc, in the sense ...

Mild spoilers
||the alphabetical naming isn't important here, it was just to give you an example. What you need to do is add all the numbers which have the same window letter.||

Not actual code but solution :
||Add the first 3 and you'll get A window
And the second 3 and you'll get B window
So on...
yet again, alphabets are not important, just append these to a list and then compare them. Good luck!||

clear cairn
#

So I hit a wall on today's puzzle and ran my data through someone else's program and it turns out I'm off-by-one... I just can't find it lol

#

Can I spoiler code?

loud yew
#

that happened with my first one, it was because i hadent converted the values to ints

loud yew
summer wave
#

what was the challenge

minor cave
summer wave
#

I forgor

#

;-;

clear cairn
#

ah thanks y'all πŸ™‚

summer wave
clear cairn
#

It's the "compare sequential numbers to see how many are higher than the previous number"

summer wave
#

so, like, "205, 210, 204, 203" would be "increase, decrease decrease"?

earnest forge
#

Yes

summer wave
#

oh

#

ok

earnest forge
#

205, 210, 204, 203 -> 1

hollow wharf
#

what exactluy

#

is this

#

exactly*

#

this advent thing

warm berry
kind igloo
#

so the puzzles started right?

#

i can still go to the website and login and start working on the solution tho right?

#

when is the deadline for the first puzzle

amber sun
#

You can work on it whenever you want, points for the first 100 to complete it

kind igloo
#

ah

#

well i think im late for points but eh

#

im mainly gonna participate for fun lol

#

but wait another question

#

can i use copilot for some parts of my code (i have early access)

earnest forge
#

Yes

amber sun
#

You can solve it however you want

#

Any language, any tools, etc

earnest forge
#

Solve the puzzle however you want (but it is frowned upon to steal other people's code if you're competing for points)

kind igloo
#

ah okay then

#

nah dont worry i wont steal other peoples code lol

#

i dont think i will ever stoop that low lol

#

wait a minute

#

does that include stackoverflow tho?

earnest forge
#

Depends if it's about the AoC question or not

#

E.G. a year or two ago one of the questions was OEIS-able

#

And Eric (the organiser) allowed that as a valid solution

kind igloo
#

ah so if i just search for a problem about a certain part of my code on stackoverflow and not about the exact AoC solution thats fine then?

rancid creek
#

googling what you don't know is expected.

kind igloo
#

ah okay then

#

thats a relief lol

#

no programmer can survive without google

rancid creek
#

I mean, hopefully you won't need that with the easier problems. πŸ™‚

kind igloo
#

i should leave the sponsor code blank correct?

kind igloo
earnest forge
#

As a general rule, if you don't know you need it, you don't need it

kind igloo
#

hopefully tho

rancid creek
#

But if you find something like "Oh I need a bfs search for this" then googling a bfs search algorithm is expected.

earnest forge
#

bfs search

kind igloo
#

ah i got it

earnest forge
#

finds bfs from all search algorithms

kind igloo
#

so like

#

if i need a sorting algorithm for example

#

i can google that and use it as a part of my code

earnest forge
#

Yes

#

(although Python has one in stdlib)

rancid creek
#

Yeah, but .sort in python is typically all you need.

earnest forge
#

(or sorted())

kind igloo
#

yeah ik i just used that as an example lol

kind igloo
dense copper
#

Dang I did pretty good

tepid cairn
#

Lmao, I did half of my solution in school

placid lake
#

lol i did today’s in the parking lot before school

dense copper
#

I’m in the PST timezone so I did it last night

kind igloo
#

lol

#

oh god i know im probably gonna look dumb for saying this

#

but

#

damn the first puzzle looks hard lol

dense copper
#

Break it down into parts. Try to determine exactly what it’s asking if you

tardy onyx
#

hey btw

#

do the challenges lock

#

when the next ones release

drifting saddle
tardy onyx
#

pog

drifting saddle
#

you can still solve them

sinful matrix
#

your username is genius

earnest forge
#

hex() is a string lol

sinful matrix
#

i thought it returned an int 😭

earnest forge
#

how would it return an int

rocky oar
west summit
#

The first puzzle my program gives correct output for the example code input that was given , then the output it gives for the actual input im given is 1 short of the answer . So I have submitted the correct answer but my program seems to produce 1 short , anyone else get this issue ?

fathom lichen
#

My wife is a teacher - she loves catching students doing things they shouldn't be doing. She has software that shows the kids desktop on her computer.

west summit
broken seal
#

I like pizza

west summit
#

for the second puzzle , we have to implement the windows ourselves ? is there a pattern ?

#

wait nvm

pliant comet
west summit
#

yes

tawdry horizon
#

I need help with day one of aoc

#

I dont understand it

sinful matrix
#

i read that twice, thought about it for a second, and realized i knew nothing about integers

earnest forge
sinful matrix
#

lol its all good, no harm done

earnest forge
#

(yeah I could tell lmao)

tawdry horizon
#

anyone?

earnest forge
tawdry horizon
#

So let's say that a = 208 and b = 210, so if 210 > 208 then count up by 1

earnest forge
#

Yes

tawdry horizon
#

But of what, I don't know

#

A or B

earnest forge
#

205, 210, 204, 203 -> 1

tawdry horizon
#

Ok

west summit
#

.aoc join

#

how do I know if I joined the leaderboard ?

tawdry horizon
#

.aoc leaderboard

hidden copperBOT
#

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

tawdry horizon
#

in #aoc-bot-commands @west summit

#

I think

hidden copperBOT
#

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

west summit
#

sorry about that , I dont see my name on leaderboard tho

sleek cave
#

let the games begin

tawdry horizon
west summit
#

Yes I completed the first day

minor cave
#

It should be updated in ~30 minutes

#

you should be one of our leaderboards

west summit
#

Okay sure , it says its owned by Joe Banks . Would this be correct ?

minor cave
west summit
#

great !

#

also is aoc just for fun and programming experience or is there anything we can get from it ?

minor cave
#

mostly just for fun

#

If you finish all the days, you will get a role on this server, the Advent of Code Finisher that will be visible for the entirety of January. It'll have a cute role icon with it too

sleek cave
#

.aoc leaderboard

hidden copperBOT
#

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

sleek cave
minor cave
sleek cave
#

ah, nice nice

#

i'll be happy if i get 30+

west summit
#

any idea how challenging they can get ?

hollow wharf
#

it is my goal in life to have a role

pastel crypt
west summit
#

I thought today was a nice way to start off , not too hard

pastel crypt
#

yeah, the first one was easy

#

you can check the challenges from last year

west summit
#

Yeah I know , I rather just focus on 1 a day

minor cave
#

I do want to clarify, you'll get the role if you finish all the days by some point in January. You don't need to finish it the same day it comes out

velvet stag
pastel crypt
#

depends how much you know, if you are just a beginner they are very hard

west summit
velvet stag
#

previous year was extra easy

west summit
#

wow ok

velvet stag
#

the hardest thing last year was assembling a jigsaw and counting dinosaurs and it took the top 100 an hour

west summit
#

assembling a jigsaw and counting dinosaurs ? lol

velvet stag
#

you get a ton of pieces like this

X XX X
XX XXX
XXX XX
 X X 
  X XX
X X X
``` and you have to connect them, so the edges fit
west summit
#

I hope I dont get that on xmas day lol

#

or something similar

velvet stag
#

so you get the picture on the right, and it has some amount of dinosaurs, highlghted on the left

#

you need to count them

hollow wharf
#

oh god

#

that sounds nightmarish

#

how did people do it

bronze vault
#

oh god.

hollow wharf
#

I'd probably create a class for each piece, and a class for each part of a string

bronze vault
#

Yo they weren't kidding when they said it gets harder

hollow wharf
#

then I'd iterate through every connection and test if each part of a string on the connection becomes filled

loud yew
quiet lily
#

Anyone know discord bot coding lol?

hollow wharf
#

no

#

but it also looks pretty fun

#

I'm excited

hollow wharf
sleek cave
#

OMG THIS EVENT IS ABSOLUTELY AMAZING

#

THIS IS SO FUN

#

SO FUNNNNNNNNN

hollow wharf
#

I AGREE
IM HAVING SO MUCH FUNNNN

#

IVE BROKEN MY CAPS LOCK KEY I HIT IT WITH A HAMMER HELP

sleek cave
#

the thrill of completing a puzzle, even if it's easy, is insane

hollow wharf
#

yes

mental knot
#

whats the puzzle?

#

where do i find info about it

hollow wharf
#

.aoc

hidden copperBOT
#
Command Help

**```
.adventofcode

**Can also use:** `aoc`

*All of the Advent of Code commands.*

**Subcommands:**
**`about `**
*Learn about Advent of Code*
**`countdown `**
*Return time left until next day*
**`join `**
*Learn how to join the leaderboard (via DM)*
**`subscribe `**
*Notifications for new days*
**`unsubscribe `**
*Notifications for new days*
hollow wharf
#

(--------;

mental knot
#

.aoc join

hidden copperBOT
#

:x: @mental knot, please (temporarily) enable DMs to receive the join code

mental knot
#

.aoc join

hidden copperBOT
#

:x: @mental knot, please (temporarily) enable DMs to receive the join code

mental knot
#

.aoc join

hidden copperBOT
#

:x: @mental knot, please (temporarily) enable DMs to receive the join code

signal grotto
#

@mental knot Read the message, enable your DMs temporarily to get the code πŸ™‚

mental knot
#

yea ik im trying to

#

i can't find the setting lol

signal grotto
#

Click on Python at the top of the channel list, then head to Privacy settings

mental knot
#

got it

#

.aoc join

#

.aoc subscribe

hidden copperBOT
#

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

polar pagoda
#

.aoc join

mental knot
#

@signal grotto thanks!

polar pagoda
#

.aoc subscribe

hidden copperBOT
#

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

exotic geyser
#

.aoc subscribe

hidden copperBOT
#

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

mental knot
#

.aoc about

hidden copperBOT
#
What is Advent of Code?

Advent of Code (AoC) is a series of small programming puzzles for a variety of skill levels, run every year during the month of December.

They are self-contained and are just as appropriate for an expert who wants to stay sharp as they are for a beginner who is just learning to code. Each puzzle calls upon different skills and has two parts that build on a theme.

How do I sign up?

Sign up with one of these services:

Auth Services

GitHub
Google
Twitter
Reddit

How does scoring work?

For the global leaderboard, the first person to get a star first gets 100 points, the second person gets 99 points, and so on down to 1 point at 100th place.

For private leaderboards, the first person to get a star gets N points, where N is the number of people on the leaderboard. The second person to get the star gets N-1 points and so on and so forth.

Join our private leaderboard!

Come join the Python Discord private leaderboard and compete against other people in the community! Get the join code using .aoc join and visit the private leaderboard page to join our leaderboard.

sinful matrix
#

YO THIS IS FUN

sleek cave
#

YES IT IS IKR

#

ah, i see you're a man of culture as well for attending the "One Anus" event ||\s||

#

so inspiring

woven sable
fathom wolf
#

.aoc join

proven kernel
#

.alf join

#

.alf join

#

.aoc join

oak magnet
#

.aoc join

latent narwhal
#

Hello @visual idolyone! I’m trying to import Hmm library on google colab, but there’s some mistake and I’m unable to solve it. Can anyone please help me fixing it

woven solar
#

...is this about AoC?

latent narwhal
limber needle
#

Done day 1, doing it on python was a breeze but trying it on shell not so much ;-;

woven solar
# latent narwhal

I don't really see how this is about advent of code. Maybe ask in a help channel instead?

latent narwhal
woven solar
#

They are managed automatically - post in a channel from the Available section and that'll claim it. this

mental knot
#

what does it want me to find here? How many measurements are larger than the previous measurement?

woven solar
#

that's what part1 asks, yes

mental knot
#

but it doesnt make sense

woven solar
#

how come?

sharp panther
#

Why not?

#

take this example

1 # greater than previous
2 # greater than previous
3 # greater than previous
1 # not greater than previous
4 # greater than previous
8 # greater than previous
2 # not greater than previous

so here, the answer would be 5, since 5 of them are greater than the previous

woven solar
#

if you mean logically in the context of the description - that's true, they aren't exactly trying hard with the justification for their tasks, lol
All the description is is flavor text to make you waste time skimming through it when seconds count hyperlemon

median shore
#

subscribe

bronze gull
#

.aoc subscribe

hidden copperBOT
#

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

median shore
#

aoc subscribe

#

.aoc subscribe

hidden copperBOT
#

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

median shore
#

.aoc help

hidden copperBOT
#
Command Help

**```
.adventofcode

**Can also use:** `aoc`

*All of the Advent of Code commands.*

**Subcommands:**
**`about `**
*Learn about Advent of Code*
**`countdown `**
*Return time left until next day*
**`join `**
*Learn how to join the leaderboard (via DM)*
**`subscribe `**
*Notifications for new days*
**`unsubscribe `**
*Notifications for new days*
median shore
#

.aoc about

hidden copperBOT
#
What is Advent of Code?

Advent of Code (AoC) is a series of small programming puzzles for a variety of skill levels, run every year during the month of December.

They are self-contained and are just as appropriate for an expert who wants to stay sharp as they are for a beginner who is just learning to code. Each puzzle calls upon different skills and has two parts that build on a theme.

How do I sign up?

Sign up with one of these services:

Auth Services

GitHub
Google
Twitter
Reddit

How does scoring work?

For the global leaderboard, the first person to get a star first gets 100 points, the second person gets 99 points, and so on down to 1 point at 100th place.

For private leaderboards, the first person to get a star gets N points, where N is the number of people on the leaderboard. The second person to get the star gets N-1 points and so on and so forth.

Join our private leaderboard!

Come join the Python Discord private leaderboard and compete against other people in the community! Get the join code using .aoc join and visit the private leaderboard page to join our leaderboard.

hidden musk
#

no

#

well, for your input you can

#

just calculate the answer then cache it :P

rugged vapor
#

oh dang, i only know a little python and theres alr a bunch of errors :/

#

anyone mind helping?

void ocean
rugged vapor
#

oh right, mb

hollow wharf
earnest forge
#

Days of Advent of Code Remaining: 30
Are you sure about that?

hidden musk
#

lmfao

mossy basin
#

bonus advent

tidal locust
#

will the puzzle become harder each day?

hidden musk
#

they tend to

tidal locust
#

ok thx

hidden musk
#

my rust sols take 30 years to compile bruh

#

Finished dev [unoptimized + debuginfo] target(s) in 2m 37s 😩

blissful cipher
#

.aoc join

gusty perch
#

.aoc join

#

Hey, I am having problems in day 1, I'm fairly new at python, and I don't know how can I use large inputs like the one the site pass us. Could someone give me a hint?

minor cave
#

So, some of us paste it into a txt file, then from our python program we read that text file. How are you approaching it?

gusty perch
sleek cave
#

yellow -> orange -> green? congrats on green πŸ‘πŸ‘

sleek cave
gusty perch
velvet stag
#

so it became space separated

#

think.jpg

hidden musk
sharp panther
#

woops, I did a dum dum

hidden musk
#

πŸ˜”

tidal locust
#

I just don't understand how to use the leaderboard api and also while testing multiple requests are needed so will you get "banned" ?

woven sable
#

So far making a custom helper class is going decently well, I'm excited for Day 2

timber glacier
#

how do i submit the code?

#

i completely forgot

stiff kraken
timber glacier
#

ohhh

woven sable
timber glacier
#

OOHHHHHH

stiff kraken
#

You go to the page with the question and just put in the answer

timber glacier
#

I FORGOT

#

yeah

#

thanks

woven sable
#

np!

gusty perch
#

idk how to proceed in part 2, any hint?

tidal locust
#

lists?

gusty perch
#

I think I understand thanks

tight dune
#

ok tht goes

woven sable
#

whoo I finished my custom helper class

#

it just has getting input and a submit decorator as of now

sleek cave
# hidden musk πŸ˜”

hello, person who first introduced me to the sublime pensive emote. i have since seen how ubiquitous this excellent emote is and have learned its ways. i thank you for showing me its beauty.

woven sable
#

What are the squiggly lines on the left?

sleek cave
#

all jokes aside, this is now my most frequently used emote-

woven sable
#

the tildes

hidden musk
#

they form a cool picture at the end if you've completed all the puzzles

woven sable
#

ooh

hidden musk
#

like last year it was a map, year before that was a space map

woven sable
#

there was a lot of thought put into AOC, wow

sleek cave
# woven sable ooh

i remember the first one was a christmas tree, then a factory, then a computer chip

hidden musk
#

yeah, the guy who runs it, eric wastl, is awesome

sleek cave
sharp panther
#

Yeah, there's so much work put into this. Apparently he spends 4-5 months coming up with the challenges.

hidden musk
#

there was a cool typhoon animation, and the sea monster lol. and the star lit up!

tight dune
#

cant wait

woven sable
sharp panther
#

Eric Wastl

low condor
#

all this talk is reminding me to get AoC++

sharp panther
woven sable
#

What's AoC++?

tight dune
tight dune
#

for

#

aoc

woven sable
#

Ahh

tight dune
signal grotto
sharp panther
#

I didn't really read that

#

I just skipped around to what I considered relevant

signal grotto
#

Neither did I but I remembered seeing the word submarine as I glanced over it

#

That's like the only think I saw from that and I've looked at it like 5 times before now without reading it

hidden musk
#

πŸ˜” the price of finishing early πŸ˜”

#

maybe i should buy one of those shirts πŸ‘€

unique osprey
#

After the solution

fathom lichen
#

2.5 hours to go!

signal grotto
#

.aoc countdown - Coming soon to a computer near you! πŸŽ„

hidden copperBOT
#

Day 2 starts <t:1638421200:R>.

tight dune
#

yayo

#

as for the people in the usa

#

do u guys stay up to do these

signal grotto
#

I'm in mountain time, so 10pm isn't too bad for me, I stay up most nights

amber prairie
hidden musk
#

yeah, they're on the website

signal grotto
amber prairie
#

ah yea, thanks... oh I could've just gone to events lol, I just changed the 2021 in the url to 2020

signal grotto
#

Yeah events has all the previous years

woven sable
#

For once it sucks being on the east coast regarding time zones

signal grotto
#

Ooh nice, eastern time

#

Yeah that's the only bad part πŸ˜‚

woven sable
#

we get everything else nice cause of UTC

signal grotto
#

Eastern is -5 right?

sharp panther
sharp panther
#

why does "utc-5" look like a file encoding pithink

hollow wharf
#

i cant any api reference for aoc

#

i feel really dumb

hollow wharf
signal grotto
hollow wharf
#

fuuuun

signal grotto
#

It's mostly meant to be done on the website, just use your browser's dev tools to trace the requests

hollow wharf
#

alright

sharp panther
hollow wharf
#

im already finished for the day

woven sable
#

and also

hollow wharf
pliant comet
#

last year was great because we had this amazing schedule where school started online at 9:00 so staying up until 1 for aoc was not a big deal

woven sable
#

Post request with your cookie with the data of a dict with the following data: {"level": part of challenge goes here, "answer": result you got} to https://adventofcode.com/2021/day/{day}/answer

#

cc @hollow wharf

#

that's how to submit for the post request

hollow wharf
#

ok

fathom lichen
#

I'm eastern time - i'm usually awake around midnight, but not for long, so i need to code fast.

woven sable
#

lmk if you wanna know how to find the cookie @hollow wharf (sorry for the ping)

hollow wharf
#

ill just use the website

woven sable
#

Ah alright

steel oyster
#

for me day 2 starts at 12:00 am (UTC+7)

sharp panther
digital ember
#

oops my bad

marsh spire
#

.aoc join

iron reef
#

I fired up the website and it said 2 hours till day 2, looks like ranking is based on absolute time so my ranking is probably as low as we'll get among the people who completed both stars

hollow wharf
#

is there any way i can automate the input taking process by requests or something? I'm currently copy pasting it. please ping me if answered.

fathom lichen
hollow wharf
#

yeah i mean i do ctrl-A ctrl-V but i need a better way, may be just copy their cookies and just request on their URL.

fathom lichen
green drift
#

i just pasted the input into a text file and used that

woven oriole
#

i tried requests but does not work due to different files for different person that would require me to log in with my credents using some cli thingy

minor cave
#

let me pull psvm's and f1re's code for it

woven oriole
#

i see

#

where can we find our session cookie πŸ‘€

minor cave
marsh currentBOT
#

aoc.py line 58

def get_input(day: int) -> t.Optional[str]:```
minor cave
woven oriole
#

not sure

minor cave
#

let me boot up chrome real quick

woven oriole
#

alright

digital ember
#

headers -> session= value

pearl needle
#

mine is empty, but you'll see a "session" value in the list on the right

#

the string in the "value" column is your session token (do not share this with anyone)

minor cave
pearl needle
#

i don't know how much harm can come from hijacking your aoc token, but better to teach good habits lol

woven oriole
#

next thing is to use it with requests?

minor cave
#

mhm, dennis's looks like:

    problem_input = requests.get(
        f'https://adventofcode.com/{YEAR}/day/{day}/input',
        cookies={'session': AOC_SESSION_COOKIE}
    )
woven oriole
#

thanks

minor cave
#

and then you can grab it with problem_input.text

woven oriole
#

yea

digital ember
#

just check for request success though, (404 erros when fetching input for non existing problem)

fathom lichen
#

Just out of my own curiosity, what is the benefit of getting the input file programmatically?

pearl needle
#

save precious seconds of time

somber crow
#

You don't need to download it manually and is therefore quicker

green drift
#

mmm those seconds

fathom lichen
#

We have very different workflows.

somber crow
#

It's also good if your lazy, but not if your too lazy to implement it

pearl needle
#

the first 100 for day 1 were all done within seconds of each other, so if you want points on the global leaderboard it's almost necessary

#

same with automating submission

fathom lichen
#

I'm so slow anyhow, while I'm reading the directions, I'm not sure how much longer the right-click on the link to dl the file takes.

#

Is there a prize for scoring high?

minor cave
# woven oriole yea

It is recommended to make your program save the input to a txt file and then ready from there. AoC organizers have asked folks not to stress their servers unnecessarily

woven oriole
#

copilot guessed what i was doing just by naming the folder Aoc lmfao

somber crow
minor cave
#

Completing all the days will earn you a role for the month of January on this server though!

digital ember
#

this is what I do, is_sucess is necessary otherwise it would create the day's folder without the correct input

fathom lichen
#

Good luck to you speedy coders out there.

green drift
#

dang thats op

somber crow
minor cave
somber crow
#

OK :)

hollow wharf
# digital ember this is what I do, `is_sucess` is necessary otherwise it would create the day's ...
import requests
def start_aoc_day(day: int, AOC_SESSION_COOKIE: str, year: int = 2021) -> None:
    if AOC_SESSION_COOKIE is None:
        print(
            f"[red][bold]AOC_SESSION_COOKIE[/bold] not found in environment variables![/]"
        )
        return
    cookies = dict(session=AOC_SESSION_COOKIE)
    # cookies = dict(_ga='GA1.2.700534864.1622907838', _gid='GA1.2.54649315.1638358225')
    problem_input = requests.get(
        f"https://adventofcode.com/{year}/day/{day}/input",
        cookies
    )
    print(problem_input)
    print(problem_input.status_code)
    if not problem_input.is_success:
        print(
            f"[bold red]Unexpected response [blue]'{problem_input.status_code}'[/blue] "
            f"while fetching problem input with URL <[blue]{problem_input.url}[/]>"
        )
        return
    return problem_input

I'm not sure why this is not working, its giving 400

somber crow
#

cookies is a kwarg?

digital ember
#

i am using httpx btw, not sure if requests has is_sucess

hollow wharf
somber crow
#

Requests has raise_on_error

digital ember
#

and cookies is a kwarg IIRC

woven oriole
#

btw the cookie would be valid for an hour right?

hollow wharf
digital ember
#

nope until you regenerate a new one

#

yeah you need cookies=

hollow wharf
#

also they are passing _gid sometimes.

#

aw shit

somber crow
woven oriole
hollow wharf
#

500 now

#

:")

sinful agate
#

lol

digital ember
#

AOC_SESSION_COOKIE also why are using _gid and stuff

somber crow
#

500 is server error?

digital ember
#

just copy the session value

woven oriole
#

cookies parameter would require a session key where you would pass the value

digital ember
#

.http cat 400

minor cave
digital ember
#

.status cat 400

digital ember
#

yeah the problem is with your cookie

hollow wharf
#

uhm

digital ember
#

its something liek this

hollow wharf
#

mine was something like this

digital ember
#

session value

sinful agate
hollow wharf
#

can be, lemme recheck.

#

yeah yes that was incorrect.

somber crow
#

200 is success

hollow wharf
#

shit yeah hold on

somber crow
#

Error and 200 are two words that can never go together

fathom lichen
hollow wharf
#

perfect. done.

digital ember
#

cool

dense solstice
sinful agate
somber crow
#

^

fathom lichen
somber crow
#

If you have 200 errors you shouldn't

sinful agate
#

complete lol

somber crow
#

And if you don't have 200 errors, those words don't go together

dense solstice
#

Fixing 200 errors

#

🧠

sharp panther
#

9 minutes!

hollow wharf
#

so anyways, for those of you who do not wish to save the file but just take the input string, you can use below code. I'm using requests so dependency of httpx does not come for me in colab.
Taken code of @digital ember and changed a lil bit, cheers!!

import requests
def start_aoc_day(day: int, cookie: str, year: int = 2021) -> str:
    if cookie is None:
      print('Session mate')
    cookies = dict(session=cookie)
    problem_input = requests.get(
        f"https://adventofcode.com/{year}/day/{day}/input",
        cookies=cookies
    )
    if problem_input.status_code != 200:
      print('yeah nah yeah')
      return
    return problem_input.text
digital ember
#

.aoc countdown

hidden copperBOT
#

Day 2 starts <t:1638421200:R>.

minor cave
#

Smh, when I can't stop the mods from talking in a locked channel

sinful agate
#

lol

somber crow
#

There's a locked channel?

sinful agate
hollow wharf
#

they have same url for 2nd star?

narrow crown
#

starting in 8.5 minutes!!!

sinful agate
dense solstice
minor cave
#

I lock spoilers 15 minutes before until the global leaderboard fills up

sharp panther
#

input remains the same throughout the day

narrow crown
#

lol go to day 1 and change the 1 to 2 in the url

hollow wharf
#

great thanks!

sinful agate
narrow crown
#

just check out the msg it ufnny

sinful agate
#

pls site don't give me timeout this time ffs

dense solstice
#

inb4 server goes down

nocturne blaze
#

.aoc count

hidden copperBOT
#

Day 2 starts <t:1638421200:R>.

sinful agate
#

good luck

green drift
#

hype

winged pond
#

oh boy

#

here we go again

woven solar
#

why do the clocks not align, I wonder

woven sable
#

Whoo

winged pond
#

global timezone when

woven solar
#

the site countdown is 3 minutes fsater

winged pond
#

unix timestamp

sinful agate
#

did you wake up using alarm clocks

green drift
#

hope its not too hard

woven solar
#

t-2minutes

wispy ice
#

t-2 min, lock your visors

fathom lichen
#

I'm looking for a challenge. I want to learn something new!

minor cave
woven solar
#

minutes

minor cave
#

... huh

sinful agate
#

clicking intensifies

mossy basin
#

clackety

unique osprey
#

GLHF everyone

woven solar
#

please don't actually F5 all the time, lol

sinful agate
#

lol

nocturne blaze
#

It's showing 1 min left

#

For me

woven solar
#

request the endpoint when the clock on the site finishes

mossy basin
#

1:03

woven solar
#

t-1minute

green drift
#

eee

sinful agate
fathom lichen
#

time to test their server....

tulip elbow
#

hf

unique osprey
#

why do i get so excited about this

sinful agate
wispy ice
#

t-30 launch sequence activated

sinful agate
#

10

somber crow
#

10s!

green drift
#

gl

unique osprey
#

lol

wispy ice
#

t-6 ignition

somber crow
#

5

hidden copperBOT
wispy ice
#

go gog og og og og og og

void ocean
#

oh crap lol

minor cave
#

Nice it pinged today

void ocean
#

i forgot

green drift
#

oh that cant be that hard

potent pumice
stable heron
#

pogs

wispy glacier
#

ohhh

potent pumice
wispy glacier
#

i thought like, locked as in don't talk abt next day stuff

wispy glacier
#

should be right about now?

deep ferry
#

it's dec 1 lol for me

#

i finished the first prob

#

need to do second prob

#

A

narrow crown
#

NO i inputted the negation of my answer

prisma sundial
#

damn

#

people were quick

#

my fingers weren't warmed up

dense copper
#

same here

#

did aight i suppose

hollow wharf
minor cave
sinful agate
#

this one is easy

stable heron
#

#4 lets goooo not bad

#

yes very easy

signal grotto
#

Aaaaaa submit cooldown

sinful agate
#

fk bro timeout

stable heron
signal grotto
#

Boom done

sharp panther
#

woohoo, done

stable heron
#

yay

normal umbra
#

Aye I solved day 2

#

and am in top 10

stable heron
signal grotto
#

Woo 6th on staff leaderboard

stable heron
#

oo

prisma sundial
#

im just glad i didn't do as terrible as i did yesterday

stable heron
stable heron
#

yeah same

void ocean
#

the 2nd one was kind of confusing

prisma sundial
#

tomorrow is scoreboard time though

hazy pendant
#

i tripped on the advent of code like ~5 times

#

i made mistakes

#

repl

stable heron
late frigate
stable heron
#

it was easy enough

normal umbra
#

part 2 had my a tiny bit confused at first

late frigate
#

i kinda blundered day 1

stable heron
#

i thought it was going to be confusing

sharp panther
pearl needle
#

damn 20 second cooldown

normal umbra
#

Fuck my rank just dropped to 10

hazy pendant
#

i blundered day 2 multiple times

north silo
wispy ice
#

that was cool

stable heron
#

oh damn

stable heron
#

i just dropped to #10

north silo
normal umbra
frozen plume
#

aye hapi

stable heron
sharp panther
#

There are multiple different leaderboards, the bot compiles them together

stable heron
#

wait

normal umbra
#

wait

#

Oh

#

Oh shit

green drift
#

no way

north silo
#

Yeah we split the server up into a few leaderboards, which we combine to make the server-wide table.

normal umbra
#

that makes sense actually

late frigate
prisma sundial
#

its tricky getting into a mindset where you don't think of your solution before you start writing code, it's so unnatural

jade root
#

holy heck that was frickin tense

normal umbra
#

well at least I am 10th somewhere.

woven oriole
#

boom

#

it was fun :D

void ocean
#

.aoc lb

hidden copperBOT
#

Here's our current top 10! πŸŽ„πŸŽ„πŸŽ„

     | Name                      | Score | ⭐, ⭐⭐
--------------------------------------------------
   1 | Oliver Ni                 |  1580 | (1, 1)
   2 | RundownRhino              |  1576 | (1, 1)
   3 | Defelo                    |  1575 | (1, 1)
   4 | asishm                    |  1574 | (1, 1)
   5 | ChaseParate               |  1572 | (1, 1)
   6 | Starwort                  |  1570 | (1, 1)
   7 | Artemis                   |  1570 | (1, 1)
   8 | artcz                     |  1569 | (1, 1)
   9 | godlygeek                 |  1562 | (1, 1)
  10 | Zeyu Chen                 |  1560 | (1, 1)

The leaderboard is refreshed every 30 minutes.

Number of Participants

791

Full Leaderboard
green drift
#

how does one finish that fast

void ocean
#

oh wasn't updated yet lol

woven oriole
#

it has not updated ig

late frigate
normal umbra
signal grotto
dim oracle
#

i got 83rd here

#

this one took like 8 minutes

#

python made it so easy

void ocean
normal umbra
#

ok so by stars, I still am 4th

#

but local score I am 10th

signal grotto
void ocean
#

.aoc lb

hidden copperBOT
#

Here's our current top 10! πŸŽ„πŸŽ„πŸŽ„

     | Name                      | Score | ⭐, ⭐⭐
--------------------------------------------------
   1 | Oliver Ni                 |  3162 | (2, 2)
   2 | Defelo                    |  3154 | (2, 2)
   3 | ChaseParate               |  3146 | (2, 2)
   4 | Zeyu Chen                 |  3139 | (2, 2)
   5 | RundownRhino              |  3120 | (2, 2)
   6 | LX                        |  3115 | (2, 2)
   7 | artcz                     |  3115 | (2, 2)
   8 | Discrete Games            |  3113 | (2, 2)
   9 | Artemis                   |  3111 | (2, 2)
  10 | Kevin Sheng               |  3100 | (2, 2)

The leaderboard is refreshed every 30 minutes.

Number of Participants

791

Full Leaderboard
void ocean
#

There we go

normal umbra
#

NOOOOOOOOOOOOOOOOOOOOO

stable heron
#

NOOOOOOO

woven oriole
prisma sundial
#

damn just barely not in top 10 😦

normal umbra
#

oh come on

rancid creek
#

ugh, I got savaged. I sliced the tip of my finger cooking and my typing speed sucks right now.

velvet knot
#

64th place, I'll take it

split niche
#

improved on day 1 at least

stable heron
#

ah come onn im #62

normal umbra
#

my score is 0 on both

prisma sundial
#

climbed 21 -> 11 though so thats nice, guess that puts me on pace for 1st tomorrow πŸ™‚

narrow crown
#

gah i multiply xy instead of depth*x 🀦

unique osprey
#

how come my leaderboard is different than what the bot says?

narrow crown
#

now i have to wait :(((

stable heron
rancid creek
dense copper
#

i had some super hype music on so i was typing as fast as i could

narrow crown
#

YES

#

I DID IT

sharp panther
velvet knot
#

Maybe I should stop using java

unique osprey
stable heron
velvet knot
#

XD

stable heron
#

python ftw

rancid creek
normal umbra
#

I don't think I am gonna participate competitively in this lol. I will just peacefully attempt it

stable heron
#

im going to try

signal grotto
void ocean
#

the first few days are really just a competition of who can type the fastest + who has fast internet

stable heron
#

although nothing's gonna happen

void ocean
#

you can participate competitively in the latter days

charred plaza
#

@rancid creek we are falling behind

narrow crown
#

90th place!!!

normal umbra
rancid creek
unique osprey
#

dang 53 for me then

somber crow
charred plaza
normal umbra
charred plaza
hollow oyster
#

Did anyone else get ghost ping by @hidden copper or what happened

hazy pendant
rancid creek
#

lol. me too. probably needed a stitch, just through some bandaids on it and kept cooking.

narrow crown
minor cave
somber crow
hollow oyster
#

Ohhh

normal umbra