#advent-of-code
1 messages ยท Page 24 of 1
One can write code in the fast cp style way and also be able to write good clean readable code in other places
these madlad got it
yeah, but in real life, good code style is almost as important
Time to go back to sleep
many people doing competitive programming never learn good code style
50/51, tied 42nd global
int a, int b, float c, long long d
Sure but that's not the fault of competitive programming
or ll d
I would argue that overuse of OOP abstraction is bad programming habits and code style
REAL
thatยดs my frieend fuckkkk!!
how do some of y'all even process the problem that fast โ
maybe, but it doesnt help that it incentivizes that sort of things
i just skip the main part and go down to the example
anyway day 1 done
yea, skip the fluff
It's just the nature of it
overuse
overuse of anything is bad programming habits and bad code style
which is why its a valid criticism
Hey ๐
you're incentivized to code fast, not code well
Yes but enterprises and institutions often preach to apply them blindly, which leads to massive overuse
/aoc join in #aoc-bot-commands
Here's the truth about competitive programming and good coding style: you can have fun doing competitive programming and be a professional programmer with good code style and more
It gives you the instructions
I'm about to drop the most noob-looking, stupid sounding question ever heard of on advent of code
where can I find the problem statement
No such thing as a dumb question! It's on the page itself.
Part of the 'challenge' of AoC is learning how to decode the strange story instructions into what you actually need to do.
i can't find it ๐ญ
i can't find anything, I can only find about the advent of code itself
Go to advent of code website -> login -> calender -> first date (not romantically tho, it's just life) -> and here you go
Tbf, nothing stopping you from having a code style professionally if you are a competitive programmer but a professional programmer doesn't necessarily make you competitive?
thx
Competitive require fast and accurate logic thinking
lesgo im 14th place
So that the first line of input isnโt the number of inputs ๐ญ๐ญ๐ญ
Why canโt they just be like codeforces
yeah, but it develops bad habits
Not really
It really doesn't unless you let it develop bad habits.
?
Each question have their rule and formst
thanks a bunch found it
I never use globals when Iโm doing usaco problems
because there's just one private input
you underestimate the amount of people who have never been introduced to programming aside from competitively
I have 2 completely different style doing this and doing a competition, still I know what I am doing if I reread it 25 days later
Ok but those people arenโt fr
real /j
Also I admire those people
Well... so what?
Not everyone who programs is going to become a professional programmer.
There's nothing wrong with people 'just doing' competitive programming.
And if they end up getting a job as a professional programmer, then they're going to have to learn a whole new bunch of skills.
Imagine getting beat by people that ain't even going to be a professional programmer ๐ฅด
we up
They manage to type out a200 line algorithm in one go using only single letter variable names
๐ฅด
chat we up
Miserable performance today (8 mins)...
I wish I had that mental capacity
lmao
real
if i somehow manage to complete all of them this year ill be surprised
wuts that
is that global lb
๐๐๐๐๐๐
Thatโs wild
private lb
wth
LMFAOOOO
Leave it to some random dude from China
pydis?
i'm 5000th place global
yeah
deleted the whole ass repo lol
I might be top 15 on pydis for now
I wonder they would get ban by aoc, but doubt tho
Please don't use AI / LLMs (like GPT) to automatically solve a day's puzzles until that day's global leaderboards are full. By "automatically", I mean using AI to do most or all of the puzzle solving, like handing the puzzle text directly to an LLM.
chat
I brute forced subproblem 2 lmfao
Yeah, I remember that so ye
I did not want to do the O(n) solution
did you just send answers until you goti t
O(n log n) for part 2
yeha
I think thatโs the smallest you can get
Sort and then use two pointer
For the first part itโs also basically the same
Sort and then traverse
no ? p2 is just O(n)
Wait how
I'd like to remind y'all that this channel has a fairly strict no spoilers policy
wait no
you can do O(n) where n is the size of the output for part 1 and 2
send answers to aoc and use timing to binary search the answer
Oopsies
Oh yeah
||Why would it not possible for O(n)||
It is
it is possible
chat i think i found the strat
What did you think ๐ฅด
I thought best would still be needing to sort
Chat Iโm not passing usaco this year ๐ญ๐ญ
ok update, looks like it was a mistake
If you are here from the AoC leaderboard, I apologize for not reading the FAQ. Won't happen again.
lmao
LMFAO
"oopsies uwu :3" type shit
Also maybe not public the solution? Lmao ๐ฅด
Public solutions are not only allowed but encouraged, so long as the leaderboard for the day is full
that link does not have the solution
Oh, did it not exist as part of the prompting thing, I thought it exist, nvm
LMFAO
putting it on github is crazy
Uhm guys you think I can participate??? Look on my GitHub for assessment....
how did 2015 gpt solve it?
definitely not
hahaha
yes ?
He solve 2015 now?
what has GH got to do with AOC, lol i remember solving some problems with pen and paper lol
You can solve previous question anyway, maybe he tried them
vim is done
perfect run script
vim input -esS main.vim -c 'call Part1() | q!' && cat part1
vim input -esS main.vim -c 'call Part2() | q!' && cat part2
ooh, this is actually better, no output file needed
vim input -esS main.vim -c 'call Part1() | :%p | q!'
vim input -esS main.vim -c 'call Part2() | :%p | q!'
who summoned
That was fun
i forgot about aoc :p
now you remember, go write some vimscript
someone should do aoc with only GH actions
sounds like a challenge for you
fenix what editor are you using throughout all the languages?
I assume neovim but thought I'd ask
it wouldnt be hard
challenge for @lusty rover
where visualisation ๐?
not a good day for a visual
i guess i could show actually searching through the list, but i'm probably not gonna do that
is this advent of code related?
imo shave the neck beard
again, is this related to advent of code?
This isn't related to coding at all
<@&831776746206265384> something kinda fishy is happening
shall i get the pole?
the pole?
ah, that kind of pole
!cban 855827898141114368 troll
:incoming_envelope: :ok_hand: applied ban to @misty moat permanently.
now we wait for day 2 which is going to be 10x harder lol
that's an amazing gif, definitely favoriting it for later use.
Heyyy im back for another advent
Lol I hope the same
any solutions for today's aoc without ||sort||
ive been waiting a year for this event ๐ฅ
Hmmm I wonder, maybe itโs time to solve AoC in Vue? Should make for some interesting visualizations
floating islands
ohh
right, the story
we're finding the chief!
so i guess it'll be some kind of map
Speaking of, what are y'all input copying and using workflow?
!pypi aoc_lube
Nice package!
can't believe i got the package name wrong twice ... ๐ฎโ๐จ
aocd is good as well ๐ #bot-commands message
Was the glowing done in an image editing program or is this some console-specific magic?
I'm going to be using this, making sure I only send one request per day :D
def get_aoc_input(day: int) -> str:
day = str(day)
aoc_inputs = read_aoc_inputs()
if day in aoc_inputs:
return aoc_inputs[day]
response = requests.get(
f"https://adventofcode.com/2024/day/{day}/input",
headers=AOC_HEADERS,
)
aoc_inputs[day] = response.text
write_aoc_inputs(aoc_inputs)
return aoc_inputs[day]
If you want to get your AOC_HEADERS, go on to the site (make sure to reload it) and inspect it
Then go to the network tab and find the Request Headers
Toggle Raw mode, copy that text and ask CGPT to convert that to a Python request header
its working great ๐
and ask GPT
bruh
Hey man, if you want to do it yourself go ahead
Not me ๐
But maybe the session cookie alone is enough to get
I fear that one day this AI thing will become good enough that I won't be able to have this kind of reaction anymore because it'll just look stupid lol
It probably is, but anyways this works and im low on time
Oh? Why are you low on time
I'm doing engineering
shouldnt you check if day in aoc_inputs before making a request?
oop
we're going to pretend i didnt just not do that
works
umm almost
day needs to be used as a str since apparently json cant have ints as keys
yeah it works now ๐
now make submit
no i mean a submit() function
you can make submit the same way you did this
bru
auto submit using a request
nah i want to feel it
i want to see the gold star pop up on my screen
i got inspired after i met someone in my uni (after talking with them in the uni discord) and they said they're doing AOC in Rust
but im just doing it, for funsies
maybe some of them ill optimize if i have time
i know that feeling, its me from a year ago when i did aoc the first time
this is my third time trying aoc, i usually just get bored and stop lol
the most recent activity in my uni discord was three months ago and that was a steam scam post
also it gets challenging at some point
this time maybe ill go for the 50 star
thats the point, at last days i spend a lot of time and most likely cannot solve it without some hints
yeah maybe i wont be able to solve everything on the same day
wait can you do day 1's thing on the next day
i only finished aoc the first year i did it
you can do 2015's day 1 today if you feel like
theres no time limit
ohh
yeah you can do any year and challenge anytime
will i still get stars tho
yes
yes
noice
easy 1st place
i dont think ill be on the leaderboard anywyas lol
if i do compete it'll be for performance
Good morning
hey
good morning
you can try code golfing
nuh
Shall I code in Python or Rust (I ainโt doing the roulette this year) - decisions decisions
do both
umm finish in python first
Could do
maybe try something except those
who pinged
if i try rust id learn something
For me this is less about the stars and about doing something new
So Iโm going to force myself to always code using Vim modes this month
damn so clean code
any < 100 rank?
is absolute value needed here?
y
for the "difference" you could use it yeah
ooh
like im pure begginer so like i dont even know if my code is right
like i wrote all this
so do you have any suggestions
are so any suggestions on thsi?
#aoc-solution-hints ask here
ooh ok ok
okay what. The question is either worded weirdly or i'm just tired cuz I just woke up
yeah, most likely
read the story! its fun
i've read it, always do : )
could you explain one thing for me please?
oh okay
i was about to ask my question but then answer came to my mind
If I post a workingsolution, is possible for people to provide with tips to optimise my code?
you can post your solution here: https://discord.com/channels/267624335836053506/1312645339609694359
should I try vimscript even when I have never used vim
probably something that automate vim
You can, but trying the normal vim may be better
Am happy to help you with this when I finish today, if you'd like :)
shouldn't take too long - just need to learn rust first
I would suggest not posting this in here even for older days.
Do you want to make a thread in #aoc-solution-hints
do people use libraries like numpy in aoc or is it generally just standard libraries only?
There have been some problems in the last years that nicely map to a series of matrix transformations, so yeah, numpy works well for some problems
sometimes I use networkx for upcoming path problems
Looking at the first problem it's set up like a matrix from what I can see, so I'm kinda like why would I do matrix multiplication if I can just use numpy
||I'm got the basic logic down using abs but need to order the two columns to compare in order||
Nvm, just used ||zip||
its not matrix multiplication though ๐ญ
You can do ||O(n)|| for part 1
Tried to one-line in repl, got hit with SyntaxError: assignment expression cannot be used in a comprehension iterable expression :c
classic
wgut
wait tell me in #1312645339609694359
To bypass it, used ||(l:=text_parsing_here)and sum(actual_calculation_here) || no semicolon, still one expression :3
noice
If there are no nested loops, just loops next to each other, then it's O(n). Because even O(100n) is O(n)
just print the answer
O(1)
logick 100
You gotta find the answer first. See definitions of O, the constant multiplier or lower-O elements of the sum don't matter
was joke
[redacted]
Ping
I mean
GitHub Actions already runs all the tests I write
Does that count?
https://app.codecov.io/gh/shenanigansd/scratchpad
80% coverage, not bad, not bad at at all
can you send me an easy beginner code of python for guess the number game
part 2 is O(n) too
Go to #python-discussion , this channel is for the Advent of Code event
Anyone manage to do recursive regex substitution
yea, with part 2 it is easier to get.
Do I need to be on our private leaderboard to qualify for the AOC completion role at the end?
Yes, you need to be on our community's leaderboard and also link your discord account to your AoC username via &aoc link
hmm I am already on a private leaderboard for my university, are we able to join more than one leaderboard?
Yup, you can joinn several
ohh okie thats good ^^
@hollow wharf
yea?
oh sorry
/aoc join in #aoc-bot-commands
ah thanks.
The application did not respond
I'll try again later.
worked when I tried again.
Yeh had the same
does anyone have solutions to AoC in languages other than python?
There are some in #1312645339609694359
oo
in part 2, do they mean how many times a single digit occurs, or how many times that exact number occurs.
for example, with the number 39842: do they mean how many times 3, 9, 8, 4 and 2 occurs in the other list, or do they mean how many times 39842 occurs in the other list?
I'm a little confused on the wording ๐
how many times 39842 occurs in the other list
this one
ok! thanks!
hope its fine, anyone who is struggling to learn python, you can DM me.
Can someone help me with day1(python)?
For some reason the result is too high
Or do I really need to make it with 2 lists
you could do it with a single list, but uh, you iterate over it in a really weird way, and you sorted the whole list when you should be sorting 2 individual rows
you take the first number, and the rest of them, then the second and the rest, ...
Wdym in a weird way
im not sure how did you even end up with this, it just doesnt make sense
i would recommend to use 2 lists and think a bit more on how to do the iteration
Oh
don't post solutions here please. You can ask for help in #aoc-solution-hints using spoiler tags, or discuss the solution openly in #1047673173447020564
Oh mb
when i finished day 1, i glanced up, and as if on cue:
(this is our first snow of the winter)
aoc is magical y'all
im waiting for snow so much
its honestly weird to not have it in december. like, it was already there in the start of november, but then the temperature got back to like 4'C so it melted
Hallo again everyone ๐
Hello
it doesnt snow where i live ๐
what helper library are yall using?
I think salt had one? I believe that's what I used last year
Yeah I realized that as well haha
!pypi aoc_lube
Havenโt tried it myself yet
right yeah, that's what I was using
I made a little website to display the community's solutions to AoC questions (here) But according to the AoC about page:
Can I copy/redistribute part of Advent of Code? Please don't. Advent of Code is free to use, not free to copy. If you're posting a code repository somewhere, please don't include parts of Advent of Code like the puzzle text or your inputs. If you're making a website, please don't make it look like Advent of Code or name it something similar.
Should I take the website down? Or is it fine if I provide credit for the design to AoC?
You can have the solutions, but you shouldn't be reposting the puzzles afaik
Got it, so I'll just replace the puzzles part with links to the aoc question?
yea, that should be fine
nice little site
thank you <3
If you're making a website, please don't make it look like Advent of Code
the author might object to this part tbh
you can just contact them about it iirc they're pretty responsive
Are these your solutions or community solutions?
I'm doing this in random languages every day
Today was rust, tomorrow is golang, hoping to land on python one of the days lol
I guess cos itโs meant to make coding in AoC moreโฆ frictionless
and because it's kinda a funny name
Oh no
how much does the difficulty scale for each day? i found the first day to be fairly straightforward, but i assume they get very tough at some point. 
for me around day 15 is where it starts to get toughy
still haven't done last years 24 part 2
oh wow
Take a look at the problems from the older years
I think the highest one I've ever made it to is 12
i might never get 50 stars ๐
I sure wont 
wow that is impressive work
look at mr richy rich over here
eh - people have done better
i suppose it is relative... i have 6 total stars ๐
if you're learning then it's all good
yes of course
also this screenshot reminds me I should renew my AoC++
brb
There that's much better :)
I pay for this and for Nitro - which I need to post my not-so-code golfed solutions in this server
lol, !paste
yeah but where's the fun in that
Or just link the GitHub where they already are anyways
it's much more fun to make people scroll instead
I pay for Nitro just for the emojis
That is also a noble reason
I do like having separate profile pics
IRL friends sometimes get weirded out by my profile pic decisions on this server XD
they can get over it
"Why is your profile pic Elsa?" "That is a difficult thing to explain"
is it possible to see completion times for the leaderboard in #aoc-bot-commands? ๐ค
community solutions
where'd you find that
based
yeah no im not completing this year
me neither
there's a first for everything
what, no laptop and jog?
"wait hold up teacher i need to do today's aoc"
"what the fuck is an aoc"
Is the leaderboard ID thing the same for this year?
yeah, our leaderboards are the same as previous years. If you were in one previously you should be good
I've somehow ended up in 2
just finished day 1
i feel
proud of myself
even tho i had to search some things up
it proved to me
i do have some tangible problem solving skills
heck i got part 2 on the first try
LMFOA mine looks the same
Congrats!
thx
Make sure you take some time to look at how others solved it and see if you see any new tricks you can pick up.
I was reminded of np.loadtxt() yesterday. There's always something new, or something you've forgotten.
btw where are the golfers at
huh
Yeah for the first part i learned about zip, split lines, and abs
so i have a link (my AoC day1 input) with the numbers right, i wanna somehow read the file and then use it to complete my code
would it be better to copy paste the data in a .txt file then use that in my code by open() and stuff?
sorry, i know im not being clear, im a very bad beginner to python, so I can't prompt properly
that's what I usually do
oui
it's not like readable nor good to have per say a 1000 line string variable in your code would it?

also looks like this year there's only like a few people who did the 2nd part?

with a name like inferno you'd better
how do I use github?
i wanna create a file for my AoC 2024
is that a good idea? how do I create one? (ive only made an account, idk anything else)
yeah, but do post your solution after like today's leaderboard has ended
(it's more said about in the about page)
wdym? post it for what
im just gonna wait until the month is done
is it to share my solution with others?
cuz if so, my code is horrible, I dont want anyone using this thing ๐
I meant if you are going to push it to Github, do it after the Leaderboard end
I dont get what you mean sorry, whats the relation with the lb and github ??
they just dont want people posting the solution so that others dont copy it
i think
ohh
We don't want solutions posted in this channel specifically. This is a spoiler-free channel.
The overall Advent of Code policy is that no solutions are to be posted until the global leaderboard fills up.
smh
You're welcome to post it in our spoilers thread (we have one for each day). If you're looking for help we have #aoc-solution-hints, where you can create a thread there or post more spoiler-y things (just not full solutions there)
GLHF everyone
hey kat, so If I were to send a Github Repo with solutions should I send it to #1047673173447020564 right?
glhf
&aoc c
Day 2 starts <t:1733115600:R>.
glhf yall
hoping for leaderboard ๐
same here
i forgot it started yesterday
Yes, or if you post it here just very clearly indicate it has solutions and has spoilers
< waking up just to do it
https://github.com/Sas2k/Advent-of-Code/ <- Here's my repo which I update at the day after the puzzle released
My solutions to the puzzles at adventofcode.com. Contribute to Sas2k/Advent-of-Code development by creating an account on GitHub.
^
this is getting exciting
i'm about to lose
guys uh which pls help
I am just using python to also get input and submit automatically
where's neovim ๐คจ
๐ข im so clueless and bad everyone so pro here that its discouraging :(
same question here
nah i'm the opposite of pro
what IDE do you use
It just loading ๐ฅด
lol
Oh boyyy
Same
same
<@&518565788744024082> Good morning! Day 2 is ready to be attempted. View it online now at https://adventofcode.com/2024/day/2. Good luck!
oh no
they rly crashed it
Poor Eric
@floral hare
In previous years when there's been server-side issues they just don't count LB for that day
ok so its not just me
It loaded for me, can I paste it for you ?
Anyone get in, what's the puzzle text?
i got my data though
alr wtf is this
Tbf, maybe just too many people load simultaneously
We won't be able to solve it wiout our own unique input, but it would be nice to see.
u can solve it with the example
yeah, at least you all can read the problem
guys so uh what do i click on again? i use visual studio code for my code so uh what do I select here ๐ญ ๐
shut up
somebody help meh ๐ญ
#1313007729048289321 created early because of the server-side issues
same
5-5-500
Alright I'm gonna stop trying and go get lunch
at least puzzle directions can be cached on the cdn
Whichever you're familiar with, VSC is a fine choice
puzzle input generator is erroring out
okayy thanks
broke again ๐ญ
woah
wtf is smalltalk
today seems to be a continuation of yesterday
guys which
doesn't really matter, you can just stick with the default
oke
this might be better in another channel though
like? im new to the server so i didnt know
177/462 today but there were a load of internal server errors lol
im not gonna place today in the slightest
Make a thread in #1035199133436354600 :)
I don't know rust. the first few days are the best days to get started with a new language
ffs i really got 1128/551
after that it gets really tough lol
because every time i submitted i was 500ing
the thing wasn't even loading for me by the time the first answers were in ๐ญ
Got delayed somewhat by a 500 server error. Still managed top 1000 in part2. Don't think I'll manage that again this year.
damn people are fast. thought i got it in record time yet still 227/184
Yeah I think the lb for today will be cancelled lol
๐
How do you know
anyways i'm not upset bc i saw it coming
Oh, in personal time
I got delayed by ide frozen so 2108/1189 (wasn't delayed that much)
Just finished both parts ๐
Perhaps this is a silly question but if the leaderboard for today does get cancelled (which it probably will) does the leaderboard aggregator understand that?
iirc the leaderboard was cancelled before
we have code to allow for that, just need to double check it and get it setup for today
There's no time limit to when you can submit answers to the aoc website
leaderboard filled after 4 minutes. Pretty amazing.
yeah its wild
it's kind of sad for me that the first time i get global the leaderboard is going to be cancelled. Although i probbaly just would not have gotten it if it was a normal day
there's daily puzzles, but you can go back and do any puzzle from any year whenever you want.
imo i dont think it'll get cancelled, but idk
granted this was an easy one, but it still took me 10 minutes to get the website to load. lol
Leaderboard was already half full by the time I even managed to load the puzzle, I'm like 90% sure the board will be cancelled
It usually is when an aoc-side issue happens
this question really messed me up
ah maybe i just got lucky then. yeah it people couldnt load it 10 mins in then that makes sense
Do notepad++ if you have it installed imo (and I say that as a vim advocate)
I wonder if Eric's going to wipe out the leaderboard for day 2 with all the loading issues.
I doubt it
to be honest, there's so much competition for the top 100 now that it's sort of lost meaning for all but a very small number of speed solvers. =/
I doubt I'll make leaderboard on any of the easy problems, I'll just have to wait for a harder problem. ๐
at least we have our private leaderboards.
Oh for sure. I just know he's done that in the past. I'm mostly curious if Eric considers the loading issues to be big enough to cancel the leaderboard for day 2 or not
It's kinda been that way since like 2018 tho
This isn't the first time there's been website issues and clearing the leaderboard just drops ... everything. It's not like he can reset it and start it over.
Just wondering, how do people on the leaderboard complete it in like 2-5 minutes instantly? Is it just a lot of practice with puzzles like this or do they have other tricks for it
Talking about people who actually complete it without AI aid ofcourse
yeah
it took me 40 mins to solve both problems.. i am slow lol
Nah, that's fine! You're doing great.
Not at all!
You shouldn't compare yourself against others... just compare against yourself. Learn algorithms, learn ways of doing problems, of writing non buggy code. Speed will come with time.
Just think of how that is likely shorter than it would have taken you a couple months ago
Thatโs how Iโm thinking about it atleast. Without sitting down for it yet but just reading the question I know itโs gonna take me some time. But I also know how itโll help me understand/learn more
guys someone did part 2 fast?
it took me like 15 minutes
๐ฆ
guuys
when you clicked in part 2
like barely it started
doesnt it took a while?
does someone else use aocd lib for submitting
i do not, i mean, you're just saving like 3 seconds
JAJAJAJ
what was your rank?
itertools is one of the best python modules to learn in general
I will too
hallo can u guys help meh read files, check the thread I just made on #1035199133436354600
thanks in advance :#
:3
Ping where?
Whats pairwise?
Itertools function
Returns pairs like [(1, 2), (2, 3)] if you give it [1, 2, 3]
So it pairs adjacent numbers from lists?
Yeah
damn, day 2 part 1 took me longer than I thought
(I might have rushed and had to restart everything from start since I messed up the first time)
Iโm gonna assume this has a purpose in todays AOC but what purpose would making pairs like this have in real world applications?
I did mine in golang today (errors as return values feels weird)
Outside of puzzles like this
you could just extrapolate the AoC "story" scenario into a plausible real-world usecase
but comparing adjacent elements is fairly common. data analysis strikes as one such thing.
^
or just cf div3 C
div1 or bust
I've tried about 4 different versions of my program and not one has given me a correct one even though it works with the example data
Usually means you're missing a corner case with your logic.
The sample data almost always leaves out some cases that will trip you up in the actual data.
you can ask for more specific help in the relevant #1047673173447020564 thread
There's only solutions threads there
yeah. ask your question in there.
or I believe you can also create a #1035199133436354600 thread if you mark it appropriately
(specifying that it's for AoC and which day)
or in #aoc-solution-hints
offtopic to python: Nothing makes me like Python more than dealing with file input in C++ 
I'm an introvert swede, how are you expecting me to smalltalk?
also for arch users trying to get the orphaned smalltalk package in the aur going, add this to the end of the prepare function in the PKGBUILD
sed -i 's/\&inbuf/(void*)\&inbuf/g' packages/iconv/iconv.c
sed -i 's/const XML_Char \* entityName)/const XML_Char \* entityName, int is_parameter_entity)/g' packages/xml/expat/expat.c
```this made it build for me
turns out some api details of libraries might have changed since...2015
making smalltalk read files took me a while
had conflicting information from different sources
i gave up on my smalltalk
what did you end up doing?
file := FileStream open: 'input.txt' mode: #read and then file linesDo: [...]
ok, got file read/write working
I'm using GNU smalltalk tho so idk if that affects things
I have a ๐
f := FileStream open: 'input' mode: FileStream read.
f linesDo: [ :line | Transcript show: line; nl ]
I tried FileStream read instead of #read and it kept erroring
still have no clue why
and yeah, I had to patch GNU smalltalk to even compile on my system ๐ฅด
idk
I'm mainly looking at
https://www.gnu.org/software/smalltalk/manual/html_node/Files.html#Files
GNU Smalltalk Userโs Guide: Files
yeah I used that too
now, how do I work with strings? ๐ฅด
(I guess I could read char by char and write my own integer parsing)
Is gnu small talk what people are using?
yeah
from what I've read smalltalk is kinda built to be used with a GUI or smthing
which is what squeak or pharo is? I think
I just homebrewed gnu smalltalk
i just split each line by space and converted each element to an integer
well, my issue is more, how do I split
splitAt looks promising, but I need to figure out how to use it
automatic time complexity calculation?
had a hand on that, but well this is more accurate with LLMs
cool thing is that it can easily fetch all years easily
thinking about adding auth + submissions as well, session cookies
- icon
Would be great if the left hand side can be appear in my ide
Then I would never need my browser to do the whole challenge
go ahead make an extension, cool stuff
๐but I don't know java
I have created a Smalltalk program!
It's hello world but I did it
ok, smalltalk done
A lot of practice with puzzles like this, opening it in split screen, and generally fast thinking
if I used a language I knew I could finish this in a few minutes
Feel more like fast typing, I know exactly what I want to do but still took like 7mins
For first part
it's not much typing
it's more fast thinking
No clue how people can do it in 2mins
for yesterday's it was ||unpacking 2 lists, sorting them, and then doing some basic operation||
Spoiler please lol
I'd definitely say it gets more interesting in the later days though
Today is ||sort the list in ASC and desc and compare, then check abs value||
like my favourite puzzle from last year was https://adventofcode.com/2023/day/21
Which I know immediately but It took me few mins to type the solution
There was a method involving ||polynomial interpolation||, but I used ||math to figure out a formula and had a lot of constant factors||
So how someone got it in 2mins ๐
They type it faster and do it more efficiently
if you know which functions to use it gets faster
Precisely 66 seconds for first star ๐
Like in pythoon ||there's a trick using zip to generate the pairs automatically||
I bet I was restarting my ide at that moment, or reloading to see the question
You forgot spoiler again ๐
your first mistake was to use an unreliable IDE
Idk I always find an ide much easier
Otherwise I might forget how to exit vim
I also don't like using extensions to get the input or submit
Because sometimes these don't work and then I lose my lb place
that was 5 minutes, so a bit slow
Welp, I checked my browser but forgot to check my ide when I wake up in the middle of the night ๐ฅด
I also didn't check that it runs at all ๐
me when no spoiler
bleh, I thought this was the spoiler channel
I did that tbf
Is time to read ๐คฃ
for day 1 and day 2 i had to violate D.R.Y
in any case, I could probably try to compete to get some points, but god I don't want to wake up at what? 5-6 AM?
my school schedule overlaps with aoc :(
Like this (X
Wow.... Thanks m8
Tbf I have no idea as well
my first year I did wake up att ass o'clock to compete
https://adventofcode.com/2018/leaderboard
Smalltalk is a purely object oriented programming language (OOP) that was originally created in the 1970s for educational use, specifically for constructionist learning, but later found use in business. It was created at Xerox PARC by Learning Research Group (LRG) scientists, including Alan Kay, Dan Ingalls, Adele Goldberg, Ted Kaehler, Diana Me...
Will have a look later. Where did ppl get it from? Looked at something called squeak
I ended up using gnu smalltalk, which I had to do some patches to to make it compile on my machine ๐ฅด
my code is at #1313007729048289321 message if you've already solved things and just want to see what smalltalk can look like
tbh, when you get the initial "oh god what is this" it's not a bad language
decently ergonomic
just quite different from any C like language
fwiw, smalltalk also usually isn't even file based
gnu smalltalk allows that
fwiw?
for what it's worth
I did not want to try to dig into smalltalk images and the vm ๐ฅด
Think I'll just stick to python
the fun of the roulette is that you get to experience a lot of different takes on programming
some parts you'll like and learn from
some parts you'll hate with a burning passion
okay jetbrains
ig there is an extension already
Looks good!
thanky
I do stupid stuff because I would be super bored otherwise ๐
I've been doing this ordeal for the last 3 years lol...
My first introduction to competitive programming, I'm really happy I did it the first year as this got me into stuff like IOI as well
intrestingly it looks like they are yet to remove the points for today from the leaderboard
LESSGOO
Iโm giving up on Smalltalk for today
The simplest stuff like โhow do I read this file and split this into strings is a headache
Iโm sure with enough time Iโll figure it out but Iโm wanting for time right now ๐
You take for granted the ergonomics of other languages until you find yourself without them
apparently they decided not to https://old.reddit.com/r/adventofcode/comments/1h4ncyr/2024_day_2_solutions/m003758/
This problem was bit tricky ๐
part 2 today was only tricky bc I tried to be clever when the brute force method literally just takes 1ms to process lol
this is the way
@weary topaz are you doing AoC?
I'm taking this to heart for all my future in programming
oh later this month there will 100% be some parts taht you cant brute force in a reasonable time, there always was at least one where the puzzle was the optimization
100%
I'd say the worst two in the last 2-3 years were these ones
I'd say the hardest problem, however, was this
Absolutely disgusting problem
Can anyone point me some AOC tools/framework that boilerplates the read/send of problems? I would like something compatible with Python
I really enjoyed 2022 Day 22
For me it was quite satisfying to write a general-ish solution to it
I remember the parsing being a nightmare
daily language roulette puns, @low condor? ๐
I saw this in aoc, any idea of what it is?
nah man
@jovial aspen
!code
probably a simple rotation cipher
ask in #aoc-solution-hints or in the relevant #1047673173447020564 thread
i guess its not, because I tried it and nothing is valid
Only if I can complete the roulette or Iโm not worthy of the display name
It was but I enjoyed that part ๐ Parsing into a meaningful data structure to complete that day
haha, I look forward to seeing them :)
@minor cave does it make sense to make a new thread in #1047673173447020564 for it? currently posted it in #aoc-solution-hints
not sure if it was existing last year
what happened of the aoc spoiler chat
which existed like years ago , 2021-22 iirc
it has a lot of my messages with codes i never saved lmao

what is aoc lube
!pypi aoc-lube
some helper functions, if you want them
please ask in #aoc-solution-hints or #1047673173447020564
Thanks, sorry!
Its an add by codecrafters.io
Seems to be encrypted using vigenere cipher.
using the key CODECRAFTERS i get:
NICE WORK, GET FTZSY% ICW BVTJ UKCBIMCH
So the key is not entirely found yet xD
GET FIFTY% OFF NEXT PURCHASE fits i think
i think there was a thread that mentioned the cipher switched half-way through
That would make sense
So this would be different cipher:
XVNVC% KTW GOXA MMQEMOTH
or maybe the key is just incomplete, i dunno
i guess easy enough to work backwards at this point though
Why I got 2 mention ๐
Probably in the staff archive
Forum channels didn't exist back in 2021
Hence why 2022 threads
Yea
The api died with this today
but the api is common obv
So wouldn't make difference
!paster
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 Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
my solution to day 2: https://paste.pythondiscord.com/AGUQ
please keep solutions in #1047673173447020564 only
weirdly enough this is a python server ๐
s
uhh passing the vectors by value
i hope you know that copies them
https://adventofcode.com like last year
so submit manual supremacy
Is it best to have 2 seperate lists to organize them properly?
Idk how else I can do it other then having a right and a left list.
Dude Part 2 took me waaaay to long
spoilers shouldn't be there. there's #1047673173447020564 & #aoc-solution-hints with spoiler tags
what
you shouldn't post spoilers or how to solve them here
don't discuss solutions here.
that's not the channel for such things
you can post in #aoc-solution-hints with spoiler tags or in #1047673173447020564 without
Okay Ima ask it in #aoc-solution-hints
const T& my beloved
mmm
are you doing the fun version?
what's that?
the language roulette ๐
yeah, but like... what
(I'll assume it's Turing complete and all)
whats yalls fastest solution so far/
Fastest as in?
My fastest time was 2021 day 1 where i completed both parts in 00:08:13
But if you're looking for runtime, eh i don't care enough to crazy optimize
My fastest time is... checks notes ... 02:36:12. Consequences of having the puzzles start at 5am for me
I'm sure some people do
runtime isn't really something we check because it really depends on the system you run it in
some of the early problems are so simple that the runtimes there are just not worth measuring
that too
My Day 1 is 85micros - at that point I don't really care to check the other solutions to see which is quicker because it's basically instant
in the rust server we got it to 500 ns p2 and 8 microns p1
well. This is a python server ๐
Any way to see the pool of lang picks for the roulette?
Later tonight or tomorrow I can provide the total pool I considered, including languages I didn't pick
Cheers, no rush, we'll be here all month
A fun challenge, keep the total time <1s
for one day or the whole month?
sum over all days
i don't think that's happening for me XD
๐
If I want to do that I might need to figure out these fancy O(n) optimizations they are talking about in the rust discord that sound like arcane spells to me
no, these early days won't matter for the total
this was my 2022 iirc
right ๐คฃ
at least it's not elisp
oh yeah that's how numbers work s -> ms -> us -> ns
I forgot about ms
oh god I hope we don't get elisp
what now?
Are there any esolangs mixed in?
hopefully there's piet
elisp is the lisp flavor emacs uses
can it even read files?
I have like 1-2 more not-quite-languages on the list, but nothing eso really. My minimum standard is the language needs to be able to read in input somehow and esolangs don't always hit that mark
My solution including automatically submitting the answer so definitely >1ms
(lolcode would)
It can take a char/num of input, I've just assumed for esolangs that the input is put into stdin, since almost all have some sort of "read one thing from stdin" instruction
I also have hopes for postscript
btw, the green color doesn't suit this message #aoc-faq message


