#advent-of-code
1 messages Β· Page 1 of 1 (latest)
The Advent of Code event is not currently running. The next event will start <t:1669870800:R>.
&[adventofcode|aoc]
All of the Advent of Code commands.
Commands:
about Learn about Advent of Code
countdown Return time left until next day
dayandstar Get a view that lets you filter the leaderboard by day and star
global Get a link to the global leaderboard
join Learn how to join the leaderboard (via DM)
leaderboard Get a snapshot of the PyDis private AoC leaderboard
link Tie your Discord account with your Advent of Code name.
stats Get daily statistics for the Python Discord leaderboard
subscribe NOTE: This command has been moved to &subscribe
unlink Tie your Discord account with your Advent of Code name.
Type &help command for more info on a command.
You can also type &help category for more info on a category.
&aoc join
:x: Failed to get join code! Notified maintainers.
&aoc join
:x: Failed to get join code! Notified maintainers.
incredible
Taking a look now
ladies and gents, it's that time of year again
it's time to stay up till 3am for the entirety of the month of december
'tis the season to be fixin' bugs
wahoo
we're up!
I wont' be able to do these at the crack of dawn, because school π
&aoc join
:x: Failed to get join code! Notified maintainers.
&aoc join
:x: Failed to get join code! Notified maintainers.
rip
four hours left π
i hope the maintainer notifications have some kind of duplicates rate limit π
&aoc join
it seems you have made your way to the wrong coast
&aoc join
&aoc join
east coast best coast
right coast right coast
no coast sad coast π’
can't spell best without est
&aoc join
&aoc join
&aoc join
might be at a disadvantage if it releases at midnight est because no way I'm staying up till midnight tonight
&aoc join
3 hours from now
yeah
no coast now :(
π
east coast was the best coast
where do you go to school? if you donβt mind me asking
i miss the philly suburbs
north philly lol
&aoc join
:x: @woven sable, please (temporarily) enable DMs to receive the join code
&aoc join
it's kind of bad π¬. there's shootings like every other week
&aoc join
yeah.. that's pretty bad
&aoc
&[adventofcode|aoc]
All of the Advent of Code commands.
Commands:
about Learn about Advent of Code
countdown Return time left until next day
dayandstar Get a view that lets you filter the leaderboard by day and star
global Get a link to the global leaderboard
join Learn how to join the leaderboard (via DM)
leaderboard Get a snapshot of the PyDis private AoC leaderboard
link Tie your Discord account with your Advent of Code name.
stats Get daily statistics for the Python Discord leaderboard
subscribe NOTE: This command has been moved to &subscribe
unlink Tie your Discord account with your Advent of Code name.
Type &help command for more info on a command.
You can also type &help category for more info on a category.
&aoc link
You have not linked an Advent of Code account. Please re-run the command with one specified.
Command "about" is not found
&aoc about
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.
Sign up with one of these services:
GitHub
Google
Twitter
Reddit
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.
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.
&aoc link
You have not linked an Advent of Code account. Please re-run the command with one specified.
&aoc link Shom770
You have linked your Discord ID to Shom770.
oh this is the discussion channel oops
&aoclink
Command "aoclink" is not found
&aoc link
You have not linked an Advent of Code account. Please re-run the command with one specified.
&aoc join
&aoc join
&aoc join
:x: @zealous brook, please (temporarily) enable DMs to receive the join code
&aoc join
&aoc join
&aoc join
&aoc join
:x: @rancid creek, please (temporarily) enable DMs to receive the join code
π¦
Why does discord hide the flag for enabling DM's every time I have to go searching for it. lol.
(under user settings, privacy and safety, toggle the all server setting a couple times and reset everything)
&aoc join
Hello, does anyone know whether any set up for AOC is required?
&aoc join
None really, but you might want to create a folder for it, and try downloading an input file from last year.
you'll have an input file for each puzzle when they're released
You can take a look at last year's day 1 for an example.
https://adventofcode.com/2021/day/1
can save it directly from browser or copy/paste directly into your ide
time to use christmas theme ide
Oh okay.
&aoc c
The Advent of Code event is not currently running. The next event will start <t:1669870800:R>.
if I joined last year, do I have to join again?
nope! Same leaderboards as last year, just added 2 more. So you should be good to go
&aoc join
Under Zig's name, right?
that's one of them, yes
4700 seconds to go
does anyone know where i can see where a leaderboard came from
there's one i joined like a few years ago but i can't for the life of me remember π
can wait for it to fill up and see if you recognize anyone
that is not one of our leaderboards
probs not
hmm..wonder what the drawing will be
Here's our current top 10! πππ
| Name | Score | β, ββ
--------------------------------------------------
1 | godlygeek | 0 | (0, 0)
2 | Daniel Brown | 0 | (0, 0)
3 | Jack92829 | 0 | (0, 0)
4 | gustavwilliam | 0 | (0, 0)
5 | janine9vn | 0 | (0, 0)
6 | Rafferty Chen | 0 | (0, 0)
7 | Hassan Abouelela | 0 | (0, 0)
8 | Sebastiaan Zeeff | 0 | (0, 0)
9 | Robin | 0 | (0, 0)
10 | salt-die | 0 | (0, 0)
damn ok @candid berry
barely made it
by prettiness
arbitrary ordering based on the order we pull the leaderboard info
i am offended ||/s||
&aoc join
:x: @amber sun, please (temporarily) enable DMs to receive the join code
&aoc join
every minute closer we get it feels like the time a minute takes is increasing
&aoc join
less than 1000 seconds
whooooooo
(how does one do input in aoc again i forget π )
oh nvm it's not like usaco
i can't believe it's december
merry chrysler
merry crisis
that's because it isn't :P
&aoc lb
Here's our current top 10! πππ
| Name | Score | β, ββ
--------------------------------------------------
1 | dawn | 0 | (0, 0)
2 | nedbat | 0 | (0, 0)
3 | Anonymous #1291621 | 0 | (0, 0)
4 | Jack92829 | 0 | (0, 0)
5 | Bradley Reynolds | 0 | (0, 0)
6 | fiskenslakt | 0 | (0, 0)
7 | Anonymous #970403 | 0 | (0, 0)
8 | HyTurtle | 0 | (0, 0)
9 | Robin | 0 | (0, 0)
10 | brad90four | 0 | (0, 0)
&aoc lb
Here's our current top 10! πππ
| Name | Score | β, ββ
--------------------------------------------------
1 | dawn | 0 | (0, 0)
2 | nedbat | 0 | (0, 0)
3 | Anonymous #1291621 | 0 | (0, 0)
4 | Jack92829 | 0 | (0, 0)
5 | Bradley Reynolds | 0 | (0, 0)
6 | fiskenslakt | 0 | (0, 0)
7 | Anonymous #970403 | 0 | (0, 0)
8 | HyTurtle | 0 | (0, 0)
9 | Robin | 0 | (0, 0)
10 | brad90four | 0 | (0, 0)
wow, the prettiness board changed a lot in the last 20 minutes
some people went and showered & put makeup on
its rigged
it's cached
my youthful good looks are fading fast
I'm literally in the PythonDiscord leaderboard why am I 229th ;-;
it'll all iron itself out in 5 minutes
i wonder if the AoC API will crash once more
Hopefully not
i wonder if AOC will go down
i really just want aoc stickers tbh
o/
7
I've done the classic AoC thing of 'guess what the first puzzle is going to be before it unlocks'
3 more minutes whooo
My answer is 'sum the integers in the input'
i also hope for pathfinding this year
i'm guessing you'll need two for loops and that's about it
how about an array!
pathfinding would be fun
my guess is min absolute difference in list of numbers
pathfinding day 1 would be funny
that would be pretty bad lmfao
please no
will be on VC0 solving if anyone wants to hang out while solving!
gods no please
hope you've got a standard algos library π
i want to make it through at least 3 days
1 minute!
1 minute!!
aoc_helper.dijkstras says hello
i haven't set up numpy or networkx in my venv so i hope that's a later date
where's our 2020 opcode programming π
will be using aoc as an excuse to polish my smart_iterator π₯΄
networkx optional dependency
wasn't that 2019
2019 int code loved that
2021 scanners my beloved π
15!
gl hf
good luck everyone
10!
GLHF
wheee
&aoc c
The Advent of Code event is not currently running. The next event will start <t:1669870800:R>.
<@&518565788744024082> Good morning! Day 1 is ready to be attempted. View it online now at https://adventofcode.com/2022/day/1. Good luck!
Stupid typo means I probably won't get lb
116 ON THE LEADERBOARD
183, 107
I didn't
rank 199 and 113, probably best I'll get all season
shouldn't have actually tried to read the first paragraph before i realized lol
i fucked up for a sec
i just barely squeaked in top 1000
I got my input parsing wrong lmao
same kek
how do you view the leaderboard here
.aoc lb
In #aoc-bot-commands &aoc lb
yep
Yep
hey sorry if i'm being creepy here, but were you the same person who gave me the cursed cube code last year?
gosh, it's been a while. i don't do well under stress.
oh god the cubes
best im gonna do all season g.g..gg.g..g
also for anyone wanting to be speedy that doesn't have their own script to fetch inputs: https://github.com/mustafaquraish/aoc-2021/blob/master/fetch.py
just run
python3 fetch.py <year> <day>
117, 116 god damn nvm
ayyy saimonyo hello again
hey π
old crowd's back
missed one character while copying, 500 positions gone π
huh interesting
damn well done. I can't believe how quick people are
(hint hint use a script to fetch)
yeah
wha
im not going full competative this year
do yall not co ctrl + a?
less than a minute later and i barely make it in the top 1k
so hopefully going to spend the extra time creating some custom scripts
I do some smart scraping to usually also find and save the sample input
is this good?
ive see people who do like submit(n) as it auto submits to aoc straight from the code
any reason?
thats really good
faster
faster, less error prone, he said he missed a character while copying π
yeah that's cool I've not gotten to that point of optimization
not as good as last year had to many erros lol
i had no syntax errors everything first try, I'm happy with myself
i both grab the input, link myself to the page, and submit via a short cli :p
considering I'm lying down in bed coding lmao
my submits are:
aoc_lube.submit(year=2022, day=1, part=1, solution=part_one)
aoc_lube.submit(year=2022, day=1, part=2, solution=part_two)
which is more verbose than last year, but they're already templated
i dont like submit in case you have a 0 then you might have to wait a min
$aoc join
my submits will sanity check
&aoc join
cool! I usually just end up panicking and print results instead of returning haha
i run it first without submitting, and then have a submit command that runs it
mine is literally just a CLI, with a list of functions for part 1 and part 2
damn everyone here so fancy and me over here just unga bunga with chrome π
oh hey same second
nice
sheeeeesh, well done
same
had a bit of a slip up on part 2, unfortunately
same
me too
everyone who did part 1 so fast π
submitted almost like immediately, still only 1000 place π
its always like that
damn @woven sable you did it before me
i took too long reading
and the stress got to me
unfortunately i have adult responsibilities like $job and stuff π’
secret is don't read π
also forgot a reverse=True in my sorted part 2 and rate locked myself 30s π©
wew
Yeah i skipped right to the example data
had to stay up for it ππ
should probably have read from the end, front part is so useless
yeah, i shouldn't have
i read the first para before remembering to not read for speed
use the spoilers channel, not this one
ah good call
aoc done for the day, gnight yall!
5am in the morning, too cold
1116 pm
is there a way to see how many total people are in the group? π
brit?
yeah
Let's gooo 15 minutes late WOO
In 4 minutes our leaderboard will refresh and it'll re-score and rank everyone between our 9 leaderboards
nice
can i use modules tho? like outside packages?
it has a pretty convenient api
all you really need to do is come up with the solution
just making sure
mhm
first day is always pretty easy, excited to see how it picks up
Elf Mi6 goes to South America for covert operation ποΈ
errr, i dunno
i have them somewhere in my code somwhere, but i'm too lazy to dig it up
what is advent of code lol
thanks
70th π
i completely forgot to read the story that was on the challenge π
that's how you earned that toppy 
exactlyyy
π
Consistent sleep schedule < aoc day 1
honestly no clue
i didnt even automate getting the input
i just pasted it right into a file
I was gonna do that at first 
if you did part 1 part 2 is really easy
is there a way to get back to this?
I didn't check it out afterwards π
leaderboard > personal stats
ahhh ty ty
^ that
rip
how'd you parse all the information so quickly? do you have macros or something to auto submit/fetch inputs?
i don't have macros
Most (fast) people use something like aoc_helper or aoc_lube or aocd which will fetch/submit from Python
(if you're writing such a library, you have to be careful to not over-request the API)
i just have a simple run script that imports my code and automatically opens the right input file
so i just have to write def p1(f): for my sol
but that's it
i don't really think auto fetching inputs / submitting helps
I mean it lets you take a stab at part 1 before it even exists
I mean I guessed wrong but still
lmao
lmao
takes me this long just to read and figure out the prompt! you're a machine!
yeah for me reading is the slowest part honestly
i prob could've gotten faster if i hadn't spent time reading the useless first few paragraphs
but last year i kept reading the problem wrong so i started spending more time on reading
haha, damn, i can't believe you were still that fast considering that
yea as the problems get harder i find i can't skip as much of the text
Hello .. bit late .. but this is my first year of participating the advent of code
welcome welcome welcome, itβs quite a fun ride
but wow, itβs so good to see some of the same people come back here together every year for AoC.. so many familiar faces
do you use any api wrapper to get the input data?
i certainly do
yeah, me as well
most of the fastest people here do i think, some of whom even roll their own
is it on pypi?
the one i use is: https://pypi.org/project/advent-of-code-data/
ty
sure np
hi back
heyy
where did the spoiler channel go
gn all
mhm, trying out per-day spoiler threads. Hopefully it helps later on when people can skip a day or two and not be super worried about being spoiled
gah, I can't do it until after school
just do it in school it's like 5 minutes grind
~~definitely 5 min grind after day 15 ~~
yup, you can share it in #1047739554913865738
&aoc join
&aoc join
hhmm whats that package
&aoc join
That's advent-of-code-data, which provides fetch and submit. I used it for a while before I found salt's package aoc_helper
I maintain the old version of that package on PyPI (aoc_helper) and salt wrote a new version (I think he's done that most years lol) which is aoc_lube on PyPI
anything notable that salt's package does differently?
so sorry if this is in the wrong spot but how do I use the input? is it a file, if so where is it?
ohh yep
very new to programing lol kinda fogot that you can just get it from the url
Most casual players just copy paste it in a txt
thats a good idea!
So the version I maintain contains a bunch of utils, as well as a CLI (with templating options)
Not sure about salt's new one
I know it has some networkx stuff
But it also doesn't seem to have the fluent list/iter classes
gotcha, cool!
&aoc join
I've just realised that my private lb is more than half trans people π³οΈββ§οΈ
we're taking over the world
one aoc lb at a time
how do you submit aoc? Do you have to put in code and run test case or what
Your code on your input will give you an answer (e.g. 1234)
Find the box on the puzzle page and enter your answer
&aoc join
so it doesn't matter how well your code is written?
Nope
As long as you get the right answer
People have solved puzzles by hand, with excel sheets, you name it
That's the primary reason why you can't submit code; aoc is extremely free-form
On the later days the algorithm is more important. First part can often be done by brute-forcing in, second part needs more thought
Yo, what is the leaderboard based on? Who can solve the problem the fastest? Or like which code is the fastest?
&aoc join
Hmm, ran the 'join', but definitely not seeing myself in the leaderboard.
Leaderboard is updated only every 30 minutes.. Can you see the baord in your private boards? ( https://adventofcode.com/2022/leaderboard/private )
Did you also enter the join code you received in a DM on the Advent of Code website?
Or like which code is the fastest?
You don't submit code for AoC, only the answer.
&aoc join
:x: @visual raptor, please (temporarily) enable DMs to receive the join code
&aoc join
Lets go advent of code again
too bad the leaderboard works that way, I'm not waking up at 5am for this
Same
same here
Just do it for fun I wouldn't care about the leaderboard too much
People ont here kind of insane anyway
right
another year another advent of code π
this is amazing cant wait till next year so i can participate. It's way above my paygrade atm
Are you going to give it a go?
i been coding for 3 weeks i see alot of ppl solving it with comprehensions which is a section im only just learning about
Your code doesn't have to be great, it's just about finding the right answer!
Plus, it's all practice :)
Why must it start at 5:00 βΉοΈ
yea it amazing im gonna follow it i learnt alot just reading ppls solutions
Definitely try to solve it yourself before looking at solutions though, it's a great way to improve
Literally ππ they're simple enough that I want to go as fast as I can but there's no point when it's so early for me
evidently I care more about fake internet points than you do
has it started?
haha il try tomorrows one i was weak today
Lol id have to stay up till 4:30 and wake up at 6:30 for school
So do I but I wake up at 4:30 to try to get on global anyway
Don't stay up until 4:30, wake up at 4:30, solve at 5, get out for 6
It's 6AM for me, which is when I normally get up, so that works (as long as I'm working from home)
Id be a zombie at 4:30
yes, at least until im swamped at work. i just moved to a new possition in Oslo you see
but im sure it should be ok
Ah, yeah, I'm not sure how long I'll cope. We're preparing a first prod release next week.
i have a long commute, so i can invest some time into doing it
Long time no see all
do i need to specfy the callorie count
... Yes?
You don't need to write kcal or cal, if that's what you're asking
Just the number will do fine
soo i dont need to specfyt the elf?
It doesn't ask for the elf, so no
so i just have to search for the biggest number?
or add all calories
of the elf
Go reread the puzzle statement
thanks
I happened to go into the rust aoc channel and was surprised about the amount of rust users. Took me a decent amount of time to realize I hadn't gone to the pydis one
&aoc join
making a list with each element in a new line
l
i
k
e
t
h
i
s
in python
are you asking how to do it or doing it?
how to do it
Might sound dumb but where is the question ?
ins thead of 1 = [element1,elemt2]
1 = [element 1
elemet2] i meant like this
how do i do that
Oh thanks!
!e this is close to what you want
print('\n'.join(map(str, [1, 2, 3, 'four'])))
@cyan sleet :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 1
002 | 2
003 | 3
004 | four
no i meant to make a list like this
element 1
elemtn 2
lists don't have a concept of lines 
if you are printing a list, then sure
if you're printing you can do something like what I showed
or loop over the list and print elements
so do do i have to painsakilnt do and fix the list my self
!e
import pprint
pprint.pprint([1, 2, 3, 'four']*3)
@cyan sleet :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1, 2, 3, 'four', 1, 2, 3, 'four', 1, 2, 3, 'four']
!d pprint.pprint
pprint.pprint(object, stream=None, indent=1, width=80, depth=None, *, compact=False, sort_dicts=True, underscore_numbers=False)```
Prints the formatted representation of *object* on *stream*, followed by a newline. If *stream* is `None`, `sys.stdout` is used. This may be used in the interactive interpreter instead of the [`print()`](https://docs.python.org/3/library/functions.html#print "print") function for inspecting values (you can even reassign `print = pprint.pprint` for use within a scope).
The configuration parameters *stream*, *indent*, *width*, *depth*, *compact*, *sort\_dicts* and *underscore\_numbers* are passed to the [`PrettyPrinter`](https://docs.python.org/3/library/pprint.html#pprint.PrettyPrinter "pprint.PrettyPrinter") constructor and their meanings are as described in its documentation above...
You can change the width argument
!e
import pprint
pprint.pprint([1, 2, 3, 'four']*3, width=20)
@hollow wharf :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | [1,
002 | 2,
003 | 3,
004 | 'four',
005 | 1,
006 | 2,
007 | 3,
008 | 'four',
009 | 1,
010 | 2,
011 | 3,
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/ogikihufeb.txt?noredirect
ah, it's trying to be clever
Am I allowed to ask for help with the puzzle in this channel if technically it can spoil the solution for other people?
(If not, where should I do that)
in any case this is probably what @narrow cloak needa
there is a thread for spoilers
I dont want the solution spoiled, I just want the answer to one basic question
you can ask for clarifications here
and what is your question
How do I detect the end of multi line input
Like the question is very straight-forward, but I dont know how to detect when to say the answer in the code
Don't use input, read from a file or paste it into the source code
&lb
Command "lb" is not found
&aoc lb
Here's our current top 10! πππ
| Name | Score | β, ββ
--------------------------------------------------
1 | Oliver Ni | 1786 | (1, 1)
2 | Cefqrn | 1783 | (1, 1)
3 | TriG | 1781 | (1, 1)
4 | Defelo | 1777 | (1, 1)
5 | Oof | 1777 | (1, 1)
6 | mustafaquraish | 1775 | (1, 1)
7 | Anonymous #1087784 | 1775 | (1, 1)
8 | artcz | 1774 | (1, 1)
9 | Zeyu Chen | 1770 | (1, 1)
10 | asishm | 1770 | (1, 1)
reading from stdin is fine
though you might want to sys.stdin.read() in this case
and then work with that
Reading from stdin is totally possible but if you have to ask 'how do I find the end of input' it's probably easier to just read a file
it's the challenge of the year again
I guess to be fair, reading from file and reading from stdin is basically the same
input() is the culprit here
the comment was about "don't use input, use a file"
don't use input
The suggestions using a file and pasting into source were easy ways of avoiding input lol
&aoc join
Advent of Code started! π³
Yes, about 7 hours ago
&aoc join
&aoc join
:x: @gloomy kernel, please (temporarily) enable DMs to receive the join code
&aoc join
&aoc join
Hate my timezone for advent of code. They all come out in the middle of the night.
Can't be much worse than 5AM lmao
Too early for me anyways!
its during uni hours for me π
&[adventofcode|aoc]
All of the Advent of Code commands.
Commands:
about Learn about Advent of Code
countdown Return time left until next day
dayandstar Get a view that lets you filter the leaderboard by day and star
global Get a link to the global leaderboard
join Learn how to join the leaderboard (via DM)
leaderboard Get a snapshot of the PyDis private AoC leaderboard
link Tie your Discord account with your Advent of Code name.
stats Get daily statistics for the Python Discord leaderboard
subscribe NOTE: This command has been moved to &subscribe
unlink Tie your Discord account with your Advent of Code name.
Type &help command for more info on a command.
You can also type &help category for more info on a category.
&aoc countdown
Day 2 starts <t:1669957200:R>.

&subscribe
Command "subscribe" is not found
&aoc subscribe
Sorry, an unexpected error occurred. Please let us know!
CommandInvokeError: Command raised an exception: MovedCommandError: &subscribe
&subscribe
Command "subscribe" is not found
&aoc join
do the puzzles get gradually more difficult as days go?
roughly
I guess I'm doing rust this year too to continue learning that 
unless anyone has convincing opinions on what else to try to learn
inb4 ||haskell||
do it in Carbon πΏ
SQL 
do they even have a viable compiler for carbon?
dunno Β―_(γ)_/Β―
how about fortran
hey guys, how can i read the contents of the input.txt file into a numpy object array? or alternatively straight into an array of sums
on another note, how could you approach this day without loading the entire file into an array, with something like numpy?
do it in assembly
haskell
damn you called me out
i'm looking for a lazy evaluation approach π
nvm i haven't learned enough to do that
parsing things in fortran is scary
unless it happens to work well with the builtin parsing facilities
does it not work like C parsing
well, the default for fortran are fixed records
though I believe some newer revision has scanf-style facilities as well
haskell is really nice for today
I would be shocked if any language wasn't nice for today
yeah but the functional solutions for python are all ()((()) yk
Today wasn't actually that hard
I havenβt checked it out yet.
it's basically a tossup the first few days
man i remember AoC 2021
I'm getting "203194" but its wrong answer
i just watched the total completed decrease every day
yep
does someone got 203194 at his first try as well
how are we supposed to know if it's right
we all have different inputs
I thought its the same file lol
there are only a few different inputs i thought
i think this should go in #1047673173447020564
I just wanted to know what I did wrong, its a wrong answer
&aoc join
its fine to ask for help in #1047739554913865738
qhahqhahq I'm still in school
Just do it while in school
no I refuse I want my fancy aoc setup
I also bet I'd have a hard time typing out Rust code on my phone
oof
Damn
get up earlier and do it
lol, I can wait till after school :p
but muh points
The AoC setup (woops, don't zoom in if you don't want spoilers)
but muh aoc cli
is that a chromebook
Yeah
Is part of the challenge to format the input?
what
all you have to do is to just provide the expected result
No like when I copy the input, it is spaced out so that its a new line on every line.
you need to parse the input, yes
Is part of the challenge to format that?
you can do anything, as long as you achieve the expected result
Do u have any ideas how to format that? Bc when I just copy and paste it in, it created 2000 new lines or smth like that.
IMO it's better just to download the file and read it into Python
wdym by "format"
don't you mean "parse"
No.
Like when I copy and paste the inputs into pycharm, it created 2000 new lines.
I found a website tho that formatted it into oneline.
How did u guys get around it?
This
You can right click on the input page and click Save as, or you can just copy paste to a text file
DAMN. I didnt realize that worked tysm
Is there a way to download the data file from the url with requests or something? I tried it and it just gives me "Each Data is generated per user" or something of the sort.
yes, you just need to get your session cookie
Is there an API for the AoC website?
as long as there's a will, there's a way
AOC POGGGGGG
aoc aoc
Yeah, just download it as something like input.txt
Then you can load it into your program in the usual way: ```py
with open('input.txt') as file:
text = file.read()
input.txt has to be in the folder that you run your code from (the current working directory) for this to work.
There's a couple libraries for it already, the one I use is advent-of-code-data (supports input retrieval and submission). Alternatively you can do it manually by getting your session token from the webpage and use requests. Just note that the dev requested you put your contact info on the User-Agent header
I have to admit, I spend way too much time just trying to pre-process the data in a single list comprehension
but also I forgot to use file.read(), which is much simpler, I was using file.readlines() which already splits the lines up
I can't get over the fact that the list comprehension using built-in functions is way faster despite having a bigger complexity than the hand written forloop approach.
I feel like I'm discovering python all over again
&aoc join
&aoc join
&aoc join
&aoc about
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.
Sign up with one of these services:
GitHub
Google
Twitter
Reddit
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.
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.
You have not linked an Advent of Code account. Please re-run the command with one specified.
&aoc join
&aoc join
didn't we have an #aoc bot commands
it's #aoc-bot-commands, I'll unshorten the name soon
What are people using for aoc this year
python, haskell
Haskell hm
I want to learn Go so probably that
or c#. one of those
trying to be employable ykhii
Debating rust/f#
Probably not gonna make it to later stages with them but i can practice for now
both
Are inputs always lists of numbers
no, sometimes letters
Rust rust rust rust
and some python, I'll do the solutions in rust first and then figure out how to golf it in python
but its not like im competing for a rank anyway
skill issue
guys, how to fix this problem?pls help(I cant post in forum)
This isn't a channel for getting python help, consider asking in #python-discussion or #discord-bots
thx
did you read #βο½how-to-get-help? It'll show you how to use forums
button is dissable
did you create a title and add content?
&aoc join
&aoc lb
Here's our current top 10! πππ
| Name | Score | β, ββ
--------------------------------------------------
1 | Oliver Ni | 1822 | (1, 1)
2 | Cefqrn | 1819 | (1, 1)
3 | TriG | 1817 | (1, 1)
4 | Defelo | 1813 | (1, 1)
5 | Oof | 1813 | (1, 1)
6 | mustafaquraish | 1811 | (1, 1)
7 | Anonymous #1087784 | 1811 | (1, 1)
8 | artcz | 1810 | (1, 1)
9 | Zeyu Chen | 1806 | (1, 1)
10 | asishm | 1806 | (1, 1)
&aoc lb Meltz014
Here's our current top 10 (and your personal stats compared to the top 10)! πππ
| Name | Score | β, ββ
--------------------------------------------------
52 | (You) Meltz014 | 1721 | (1, 1)
1 | Oliver Ni | 1822 | (1, 1)
2 | Cefqrn | 1819 | (1, 1)
3 | TriG | 1817 | (1, 1)
4 | Defelo | 1813 | (1, 1)
5 | Oof | 1813 | (1, 1)
6 | mustafaquraish | 1811 | (1, 1)
7 | Anonymous #1087784 | 1811 | (1, 1)
8 | artcz | 1810 | (1, 1)
9 | Zeyu Chen | 1806 | (1, 1)
oh sorry thought i was in the bot channel
&aoc join
more like trivial if you know how to parse input
lol, I did today in vim on my phone over ssh
in...vimscript?
&aoc join
&AOC lb
Command "AOC" is not found
&aoc lb
Here's our current top 10! πππ
| Name | Score | β, ββ
--------------------------------------------------
1 | Oliver Ni | 1826 | (1, 1)
2 | Cefqrn | 1823 | (1, 1)
3 | TriG | 1821 | (1, 1)
4 | Defelo | 1817 | (1, 1)
5 | Oof | 1817 | (1, 1)
6 | mustafaquraish | 1815 | (1, 1)
7 | Anonymous #1087784 | 1815 | (1, 1)
8 | artcz | 1814 | (1, 1)
9 | Zeyu Chen | 1810 | (1, 1)
10 | asishm | 1810 | (1, 1)
&aoc lb Iggymojungle
Here's our current top 10 (and your personal stats compared to the top 10)! πππ
| Name | Score | β, ββ
--------------------------------------------------
160 | (You) Iggymojungle | 1506 | (1, 1)
1 | Oliver Ni | 1826 | (1, 1)
2 | Cefqrn | 1823 | (1, 1)
3 | TriG | 1821 | (1, 1)
4 | Defelo | 1817 | (1, 1)
5 | Oof | 1817 | (1, 1)
6 | mustafaquraish | 1815 | (1, 1)
7 | Anonymous #1087784 | 1815 | (1, 1)
8 | artcz | 1814 | (1, 1)
9 | Zeyu Chen | 1810 | (1, 1)
&aoc lb DJJ05
Sorry, your profile does not exist in this leaderboard.
To join our leaderboard, run the command .aoc join. If you've joined recently, please wait up to 30 minutes for our leaderboard to refresh.
&aoc join
Here's our current top 10 (and your personal stats compared to the top 10)! πππ
| Name | Score | β, ββ
--------------------------------------------------
118 | (You) ScientificGuitar | 1599 | (1, 1)
1 | Oliver Ni | 1834 | (1, 1)
2 | Cefqrn | 1831 | (1, 1)
3 | TriG | 1829 | (1, 1)
4 | Defelo | 1825 | (1, 1)
5 | Oof | 1825 | (1, 1)
6 | mustafaquraish | 1823 | (1, 1)
7 | Anonymous #1087784 | 1823 | (1, 1)
8 | artcz | 1822 | (1, 1)
9 | asishm | 1818 | (1, 1)
&aoc join
&aoc join
:x: @hollow wharf, please (temporarily) enable DMs to receive the join code
&aoc join
can I know how many minutes it took the first 100 one to solve today challenge ?
About 2
is their some source I can check ? where did you see that
after getting your help about \n , it took me 30 minutes
I can't find the puzzles
did you visit this https://adventofcode.com/2022/about?
29 seconds to solve the first part
woow
it took me 15 minutes
15 * 60 = ? maybe 900 seconds
but to be honest I rarely write code
I did but I can't find anything
did you login with your github or any other alternative ?
Yeah
&aoc join
?
https://adventofcode.com/2022
on this page, the 1 at the bottom is a link that will take you to the puzzle for the first day
ty
so I know I think how to resolve the math problem, but I'm having trouble finding out how to grab the input given in to my code. I've put it in to a .txt file, but I'm unfamiliar on how to grab it from there. Is that an appropriate question for here, or should I go to #1035199133436354600 , or should I avoid asking here altogether lol
I know also about workinmg with files but again, the way it's formatted, etc. Anyone have some resources or something?
most of us save it into a .txt file and then do some form of:
with open("input.txt") as file:
data = f.readlines() # This part changes depending on how you want to parse the input
For instance, last year this is generally what I did:
with open(r"day6/input.txt", "r") as f:
data = f.read().splitlines()
and I may add additional parsing after to get into the format I want. Like:
data = [int(x) for x in data[0].split(",")]
I think splitlines is exactly what I was wondering about. That separates them if there are line breaks?
mhm
@low condor lets move here, don't want to end up cluttering the solutions channel
wouldn't different problems have different algorithms though?
and even if they were reverse engineered, wouldn't it be just for that one particular problem and one particular year?
I agree, but aren't those arguments in favour of just collecting all the input.txt files if you could?
no reverse engineering or anything. Just grab the files and grab the problems
i'm not sure i'm following, its a bit late here <_<
I think we might be thinking of different things in the term "reverse engineering"
I was thinking you were referring to trying to generate a valid input for a particular day
yes, what i got from the reddit thread was somehow you could grab a bunch of inputs along with the problem and obtain the algorithm that was used to generate the input, which.. doesn't really make any sense
Right. So I guess even if you have the inputs, you still need to know what the algorithm was for a particular day to be able to copy that puzzle
But, just having the input is advantageous over not having it
if you don't have the input, you still need to figure out the algo, but on top you now need to work out the inputs that are valid for it
damn todays one was pretty fun bcs it wasnt hard
rust, but I ||hate|| the idea
is it only possible to solve problems on the day they are revealed or can i miss some and solve them a few days after
Looks like a harder-than-usual Day1
You can solve the AOC later, it's just there's a leaderboard
ah
You can solve AOC 2015 now too lol
oh
I will be doing this year in Julia as usual
but doubt I do it completely
I've not completed any year
my problem was that i wasnt reading the stuff correctly and thats why i tried submitting a list instead of an int on pt2 like 3 times
i think most free certificates arent worth anything
how do the different modes work on mobile?
just as usual?
or what's the question exactly?
all keyboard stuff works as usual, touch even works for mouse stuff if you want that
huh. is there an esc key?
There honestly should be an AOC standardised component that does the necessary grab-once-and-save portion
with the right keyboard, there is π
that's horrible
it's amazing and terrible
oh boy
small buttons, but it's a full keyboard with the keys where you expect them
so nice for programming, because special symbols
your finger tips must be smaller than mine, and mine are SMOL
I typo a vunch, especially of I'm walking atthe sme time, let's post this thing unedited ad an ecamplw
so I tend to need a second pass if I write regular text π
are aoc questions normally harder or easier than todays one?
harder
they tend to get difficult as the days go on
ok
there is some variety though
last year's was harder I thought
I did a naive approach for last year
there are a few genuinely hard each year
This year the 'challenge' is to keep to an O(1) or O(k) memory solution
i.e. not storing all n elves
beacons from last year as an example
isn't this just str counts
I was stuck for a while before I realized an approach that works, for most tasks it's fairly obvious to me what to do
this is also why I picked up a new language for last year
i don't remember exactly but i think i struggled a little for the second part
to not grow bored by easy problems, easy problems in a new lang is very good practice
me doing them in rust wasn't exactly a bright idea since i keep dropping the language like a hot potato
very much "I know exactly what to do, but how do I spell it in rust" for me
xD
also, "omg, I just want a useable linked list"
i used to do them in python first then move onto rust
ended up ditching rust halfway
again
already made that mistake for leetcode but decided it would be good to make that mistake again π
that's why you do them only in rust π
smack your face into the rusty wall until learning happens
LESGOO AOC
@strange zinc don't worry about it, i feel like it's almost borderline fearmongering on something that's trivial as input files
add it to gitignore and call it a day, it isn't actively discouraged which is why you see no mention of it on the website itself
already quit the advent of code couldnt figure the first one out π
What are you struggling with? Input? Writing the code?
I have already ditched my self-imposed challenge to do the whole month in Groovy, time to switch to either Fortran 77 or Deno
what's wrong with the built in?
it doesn't support things like insert/delete at a position in O(1)
huh, that's pretty bad
I think there is development going into that, but I can't remember what the state of it is
basically, that kind of thing doesn't play well with rust at all
I guess it's in nightly now https://doc.rust-lang.org/std/collections/linked_list/struct.Cursor.html
A cursor over a LinkedList.
I geuss https://doc.rust-lang.org/std/collections/linked_list/struct.CursorMut.html is the more relevant one
A cursor over a LinkedList with editing operations.
maybe I should go back to last year to optimize one of my solutions with it 
I ended up doing O(n) operations on a Vec instead
Finger trees would work for rust, but I doubt anyone made those
Maybe in im, who knows, really
yeah because it was never supposed to exist
gankra, the person who trimmed down std::collections before 1.0, tried
but people for some reason wanted a linked list
your best bet might just be copying an implementation from too many linked lists. some of them should be pretty good.
is that the person that wrote learning rust with linked lists
yes
oh right
the last one has cursor for that
maybe it was reimplemented from the book to the stdlib
or something like that
^
oh sorry
having something like a cursor interface is basically the one reason I would reach out to a linked list specifically
basically all else can be abstracted away from my behind a deque interface
so a linked list without it is kinda...useless
thankfully maybe rust will get one someday
yes
is there different leaderboards (not that i think i would have a chance)
but i assume by the time its made for americans?
&aoc join
it's for anyone. the time is because the person that hosts it chose the time to be easy for him
how do I post in spoilers
wooo, starting on the first day of aoc
you don't create a post, use the one for today
k
where were you the last 17 hours
so right as i wake up for school you just finished school
@tepid cairn i need help
this isn't a channel for getting help in, have a go in #python-discussion or #discord-bots, or create a post in #1035199133436354600 (see #βο½how-to-get-help)
&aoc c
Day 2 starts <t:1669957200:R>.
off by 1
Oop
6 hours and 15 minutes
Hi, has advent of code begun
How do you do you do that fancy thing that colours your code nicely in discord?
Yes it has, the 1st day has been going for ~19hrs
!code
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
ty
Thanks
np
some fast times https://adventofcode.com/2022/leaderboard/day/1
hat does this mean in advent of code "@##@@#@@#@@@@@###@#@@##@@@@##@@@@@@@###@@#@@#@@#@"
like the thing we see on main page
The unexplored areas..each day, a new line is revealed
ahh i c
When you complete each task, the line gets coloured and a picture is slowly revealed. In first year, 2015, the shape was clear even without the colours - https://adventofcode.com/2015
It seems that this year, the line changes the characters as well as being coloured. 
The shape is usually connected to the story about collecting stars that year. Last year it was a submarine looking for Elves' lost keys. The shape is also clear. https://adventofcode.com/2021
hey! Its better to stick your solution into #1047673173447020564, rather than here
I'd delete the message too, since people might still be working on it
Ah I'm so sorry, I thought this was the channel #1047673173447020564 π oops
it's all good :p
waow there is a part 2
yes MAAM
my program was probobly the most inefficient garbage, but i still did it
its all on my github
y does python give up on me when i am in hurry lmao
is there a reason simple sort is returning none
an in-place sort won't return anything, but maybe you should discuss in #1047673173447020564
now, you could also solve this without sorting in O(n) time
even if the number was not 3
keyword to anyone interested: ||quickselect||
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
un huh
and?
||np.partition go brrrrrrrrrrr||
partition is an awfully general term for that operation
C++ uses partition for "partition by this predicate" which feels more sensible 
that's what it is
speed 1
huh
&aoc countdown
Day 2 starts <t:1669957200:R>.
&aoc c
Day 2 starts <t:1669957200:R>.
sum, sorted
can i do [].sum
sorted()?
@torn thorn :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 10
002 | [1, 2, 3, 4]
i have to manualy do sum(lits)?
well that's how you get the sum of the list all at once
something = sum([3386,4242,3179,7596,1099,1223,6241,1020,4869,4247,4906])
sure
uhh
yeah that probs works
!e
print(sum([3386,4242,3179,7596,1099,1223,6241,1020,4869,4247,4906]))```
@torn thorn :white_check_mark: Your 3.11 eval job has completed with return code 0.
42008
and can i make a lits of lits
yes
nums = [[127, 29812, 2893], [21783, 2189, 478, 578], [378, 23874]...]
but then you can have to acces it with a second index
like nums[0][:] = [127, 29812, 2893]
and nums[0][0] = 127
nums[0][:] is just nums[0]
i cant just do [list1 , list2]?
you can
you can jut assign the lists to another list or append them to it
um, then list2 isnt a list
sooo sum is not a list?
15 minutes left
woot woot
no sum(list) gives the sum of the elements of the list
can i still do list1.sorted
yeah you can
so list inside a list then i do sorted solution done
I've been waiting all night for this ;-;
um, list inside a list, then you need to find the sums of the internal lists, save that into another list and then you can sort that list
not sure if sorting the first list will give you the correct sorted list
I'll try it, sec
just put sum(1,1,1,1) when defining?
&aoc lb
Here's our current top 10 (and your personal stats compared to the top 10)! πππ
| Name | Score | β, ββ
--------------------------------------------------
5 | (You) Oof | 1865 | (1, 1)
1 | Oliver Ni | 1874 | (1, 1)
2 | Cefqrn | 1871 | (1, 1)
3 | TriG | 1869 | (1, 1)
4 | Defelo | 1865 | (1, 1)
6 | mustafaquraish | 1863 | (1, 1)
7 | Anonymous #1087784 | 1863 | (1, 1)
8 | artcz | 1862 | (1, 1)
9 | asishm | 1858 | (1, 1)
10 | Zeyu Chen | 1857 | (1, 1)

