#advent-of-code
1 messages · Page 16 of 1
rip
I'm kinda regretting going back and doing day 5 part 2 the efficient way
this is pretty annoying code to debug
what'd u write it in?
rust. but the annoyingness has nothing to do with the language
this one might be a >24hrs ngl
i dont even know how to approach this in a non naive way
i just cant come up with a way
ive always avoided range style problems
havent solved anything similar yet
I got stumped a little by part 2 as well, but doing a little data exploration on my input and I have some new ideas
maybe you should activate your inner monoprologue
same, hopefully we won't be getting more ranges...
ffs, =< and => are the most cursed ways to write inequalities
yes
lol, erlang has =< and >= 🙃
it's =< and >=
i'm about to manually min the output ngl
I'm just dumb
do you have a list?
no i just have the query results. idk how to make a list of them either 🥴
wdym query results?
like, i'm doing it interactively
🥴
shh
oh, I managed to make something that finds all shifted intervals
now how tf do I find the non-shifted ones?
i got part 1 finally 🙄
prolog recursion is such a mindfuck
append([], List, List).
append([Head|Tail], List, [Head|Rest]) :-
append(Tail, List, Rest).
I could not even begin to imagine doing today in an unfamiliar lang
i think if i was familiar with prolog it would be a breeze
if you lot can do it, very impressive
I still haven't gotten part2 in Python
part 1 is not too bad
I still haven't really started working on part 2 though
I only just did p2
wrote a naive solution
took me hours and rigorous tests
Wanna help me?
i hope it finds the solution within the next 3 hours
I kinda want to refactor my code first
good luck
I don't need luck - I have tests
bruh
bruh contains the mappings
bruh
looking at the reddit memes I'm mildly surprised today is brute-forceable
okay, back to work on day 5. Wish me luck
i took one look at the input file and thought the brute force would be a terrible idea, but seems you can make it work
i think i'm just gonna run the brute force overnight and see what happens
wait part 2 ain't even that hard
either you're a genius or you missed something
then why do bruteforce
latter it is
this check shouldnt affect my runtime right?
1e9 of those should fit in 1 second
?
but division is slow
reiterating my dislike for the name of itertools.batched
chunked
2.5seconds for 1e6 checks
that's quite slow 🤔
I hope you're using optimization flags
25 for 1e7
4:10 for 1e8
ok ill let it run while i sleep
41:40 for 1e9
assuming that sol is below 5e9
thus around 3 hours
i just want the golden star
maybe num & 0x7FFFFFF == 0 would be faster? although it won't be a round number anymore
removed the statement completely
just wanted to time my program
without using a buildin timer
but thank you
f(A, [X], [range(A, X)]).
f(A, [range(L, R)|Tail], [range(A, L)|Rest]) :- f(R, Tail, Rest).
:- f(-100, [range(1, 2), range(4, 9), 100], L), writeln(L).
```that'll do it
[range(-100,1),range(2,4),range(9,100)]
my head cries
i think that's how crying usually works
can i send you my algebra hw
20$ and ill do your homeworl
nah not worth
3 lowest hw grades get dropped and there are only 2 left
i could get 0s and still ace the class
cant you just cheat on your homeowrks
i wish i had homework grades
i love chatgpt
whenever my teacher asks something, i ask chatgpt the same question
and then use chatgpt's answer

and get an a in class
oh abstract
yeah
rip
Man I thought I had a good solution, part 2 taught me different
wild
i love easy leetcode problems
easy
3min runtime wouldn't solve a leetcode problem 😄
like todays daily leetcode
im not talking abt this problem
ah k
Part 2 is 34 milliseconds for me
How is the bot leaderboard here different than the AoC leaderboard? One has me at 116th, the other has me at 16th.
arguable
so it turned out to be 😦
WAIT I'm not NOT not dumb maybe
Schrödinger's dumb
3 jane street guys in top 100
wasn't there a site with the entire aoc leaderboard for the python server or was that taken down in favor of the command?
i thought they work 24 7
you meant he private leaderboard?
its still avaiable
yeah the global command links to the global leaderboard
I finally figured out the solution
for i in range(1e20):
response = submit_answer_to_AoC_and_parse_response(i)
if response:
break
``` see you in a week
range(1e20) is a TypeError lol
Mmm... is it a good solution if it only works because of the specific values in the source data?
yea good enough
eeeh how do I write it correctly?
10**20
(1e20 gives you a float)
yeah the bot used to link to a full leaderboard
#aoc-bot-commands message
good spot
Lots of pre-existing libraries they glue together, particularly for parsing.
how specific?
usually the input is more constrained than the problem describes, but oftentimes includes one or two edge cases not included in the example
I'll let you know if this works
You can find such a leader and click through to their github and find their code ... and libraries.
There's at least one person who wrote their own AoC DSL.
DSL?
Domain-specific language
Answered above
Honestly though I can't even understand the problem or physically write code that fast
it's wild
ah
oh
damn
understanding the problem already takes more than 3 minutes sometimes
when you watch videos of people solving the google coding challenge I would expect they are the same people that some these in minutes, crazy to watch
Here's one guy who's in the top 5 (For day #4) : https://github.com/nthistle/advent-of-code
codejam?
There's a lot of libraries, very compact code. So it's lots of practice code golfing and doing competitive stuff.
ah
that might be the name
watched his video on day 4
we've escaped the great filter once more, see you tomorrow peeps
I found one person who had tools that hits the AoC website and grabs the sample data, then the input data; downloads it, builds a skeleton project with their AoC library, and then pops open the IDE onto that project.
I got Day 6 in 2021 in 9 minutes, 36 seconds. I was ranked 2838.
Haven't done any better. It's futile, since I'm not going to write my own library or any of these tools.
prolog when?
Ye
Idk if im just out of practice but this year feels much harder
Maybe im just dumb, who knows
you fell off
Peaked many years ago
Tbh today's part2 wasnt that hard
I think i just panicked when i read it lmao
Put it off the entire day
i mean i could write soem functions before
but idk how useful they would be
i know what i want. i don't how to get it
since üroblems so far didnt really require anything that couldve been prewritten
You're using prolog today?
except reading input
ye
oh?
recursedion
are we allowed to use libraries such as regex in advent of code?
BRUTE FORCE FTW
why shouldnt you
yeah - you are discouraged from using AI tools like GPT, but other than that you are allowed to (and incentivated to) use any tools available
regex is a great tool, but not a hammer
a year ago
i still remember reading the docs and not understand them
the pain
the suffering
regex
it comes with practice, personally I don't write any regex without using regex101 or a similar site
Jimi Hendrix had the same problem. And he turned out okay.
Mostly.
i rarely use it for searching
found out that the ctrl+f search thing has regex
Of course. You can't write a program with zero libraries.
I use it a lot for search and replace, can be really handy for cleaning up input and stuff like that
false, harder, but feasible
It seems dumb to debate it.
But I look forward to your live-stream of flipping switches on your Altair to get one of the solutions running.
whats the library people are using to import the data and submit results
This one? https://pypi.org/project/aoc-lib/
i use my own
Yeah, personal bespoke ones abound
i could probably publish mine on pypi
i need to go on site tomorrow so i can't stay up to do AoC tonight :(
rip
F
i'll try to leaderboard for you
ty
oh hey today was my 200
at least on this account
nice
i got zero for my answer wtf 😭
it works for the test data but not my input data
and i made sure to ||clear all the old seed values j to get the final location mappings at the end||
sees day 5 part 1
"what a beautiful day for another ||naive simulation||"
answer passes :D
sees part 2
oh.
time to ||overlap intervals!!||
i'm going for the minimalist approach this year
fuck i'm just now getting started. part 2 gonna be interesting
I had like -600mil for my answer at one point
i now have ideas
brb
Day 6 is going to be better, right?
Ooo! Where can you get that page?
i'm confused for part two
||so even if you have a map that entirely remaps a range, you still keep the original range bc it stemmed from the initial seeds?||
||bc now i j have a 0 in my ranges which kinda fucks up my code||
||No. The number of seeds is constant after each remap, you don't keep the old ones.||.
how would it be constant though?
||ranges can be split into multiple new ranges no?||
i have a plan of action af but i require sleep
must save til tomorrow 😔
total number of ||seeds for all ranges|| should be constant ||even after splits||
I mean sure, but ||the number of seeds is quite big||
I think ||the number of ranges will grow at worst linearly with the number of shifts there are||
||multiple new ranges that should have the same total length as the original range||
Language Roulette: Day 6
The language is ... F#
Gb moment
yet again am outside
I'm gonna hope my parity theory is true and day 6 is of normal difficulty for day 6
GL everyone
f# is surely a lot better than prolog
<@&518565788744024082> Good morning! Day 6 is ready to be attempted. View it online now at https://adventofcode.com/2023/day/6. Good luck!
oh good, today is a normal speed day
The data set is so small part b must be something really evil
It's more bearable I think. I might actually try
That was faster than normal I'd say, wow
yep, that was really fast
That wasn't too bad
finished already?
Messed up my comparison for p1 though which probably cost me at least 20 places though lol
I need to catch up to the previous days first 😩
school needs to stop schooling for a bit
fuck i missed the start
what the fuck is this day compared to the previous ones
this should have been day 1 or 2
yeah
god i'm so bad
i have no clue how this works
BRO I THOUGHT I HAD TO ||SOLVE THE QUADRATIC FORMULA||
I like comprehensive short challenges better than hard to read challenges
it wasn't
still stuck on day 5 lmaooo
got baited tbh
would be so sick if today's language was maple or something
I swear it would be
nice
Was sitting there going it can't be this easy...right?
(especially after P2 last time)
the numbers could have been a bit larger 😭
I think if they make the input bigger, it would be more interesting
!!
Ppl would then find ways to optimize their code since it would take forever to brute force today's problem
I saw the small input and just decided to brute force it haha
Knowing when to brute force is also a skill lol
Cause the problem is exactly the same
yes but the speed requirements
Yeah
I'm wondering how fast did today's 1st place do lol
Is there a way to see that on the website?
i was about to start coding a smart solution until my old code worked within 6 seconds
My laptop is kinda weak so it took 10 secs to run the bruteforce solution
you can see the times here: https://adventofcode.com/2023/leaderboard/day/6
||a smart way was quadratic formula, no?||
you saying this made me try myself. I was so certain it'd be too slow.... took 5 seconds 😑😑😑😑😑
And 5mins if you want to be in the leaderboard
lmao
Yep, that was fairly easy. Brute forced part 1, wrote more efficient method for part2.
Yep, makes sense, looking back at the input, brute force might have worked.
(also I ended up using ||bisection, an O(log(n)) method, and in retrospect using squares and square roots might have run faster and been written faster||. Eh, still ran too fast for me to notice a delay).
in USACO usually they have numbers well over 10^9
the speed of python amazes me sometimes
ikr
||square roots... would be O(1), no?||
actually
for non-bruteforcable problems at leat
and i doubt ||"bisection" is O(log(n)). I wonder how you implemented it? is this for pt2?||
Today's equation had a bell-shaped graph
So we just need to find 1 end of the solution and mirror it
day 5 pt 2 is cancer
my issue was the way i split ranges 😭
ikr
Also we can take bigger steps to make finding the first solution much faster
never gonna spend this much time debugging again
I struggled for 2 hours with that one lol
whats the point of part B if i didnt even need to change my code?
maybe authors forgot a couple digits on the input
I think they made the input a bit too small
Yep. ||For part 2, used basic variant of bisection algorithm. used 0 as low end, time/2 for high end. Distance travelled is O(1), number possible speeds is O(1). Then return if t is fast enough but t-1 isn't, otherwise standard bisection (except I didn't bother with cacheing||
If the input is bigger, part B could become quite a struggle
you dont even need that... i can do it with a piece of paper in 7 seconds
no code needed
there is plenty of room for optimizations
But because the input is small enough, I think people mostly could just bruteforce it
right
Much faster than sitting there thinking of a smart solution
i expected it to be hard so i wasnt online at exactly 11:00 and my coworkers beat me 😠
Maybe they intend this as a breather? Since yesterday's part 2 was a disaster 😂
Wow yesterday's first place took 8.5 mins to earn 2 starts
is that high?
There's always #1047673173447020564
I'm sorry for asking that, I just spent way to much time breaking my brain
Thanks
scared for tomorrow 🥹
change you input 🙂
i just removed spaces from input.. rather than map to str and join
the calm before the storm
difficulty level of AoC this year
'Fucked' if i%current_day else 'EZ'
thats a no no word
the calendar looking nice... i can see gondola
My favorite part is still the trebuchet
this channel should remain as spoiler-free as possible, delete it and ask in #aoc-solution-hints or #1047673173447020564
ok
so day 6 was easier than day 1.. why would they do that? 
My guess is by putting hard days near the beginning he's hoping to dissuade people who might use LLMs
from the about page on the website:
Why was this puzzle so easy / hard? The difficulty and subject matter varies throughout each event. Very generally, the puzzles get more difficult over time, but your specific skillset will make each puzzle significantly easier or harder for you than someone else. Making puzzles is tricky.
I mean yeah but even among the variance in advent of code day 6 was clearly much easier than day 5
yea, i mean, as soon as i saw day 5 i knew day 6 was gonna be easier lol
yeah
daw
daw?
i tried redoing day 3 part 2 this morning but i got so irritated i gave up temporarily
is there any private leaderboard for this server?
You could go to aoc-spoilers if you are really stuck
Treat it as a learning experience and do better in the next challenges
I tried the /aoc join command from the aoc-faq channel but there are only 10-20 active ppl there.
ah thanks, I am very bad at reading
although tbh they should just put the join code in the channel descriptor
I’m really hoping, no monkey map this year
we have multiple leaderboards because of the limit
oh i see
Tried to see but it's all in a different lang sadly
I'll try to check tho thanks :)
well, todays very easy...
i need to return to yesterdays, didnt want to bother in the evening after work
i like the cube one from last year
I wonder why today's was so easy
i applaud people who get this done in a few hours. it takes me all day sometimes. and sometimes i dont even get it./ But I suppose thast what learning and chalenges are all about. I agree that todays challene is so much easier. Not that i have done it yet.
ah day 6 part 1 is a bit of physics, finally I can feel at home a bit 😄
who knew that the good old ||quadratic equation|| would make an appearance
While the thing does look familiar, I can't remember the last time I actually did something with it.
well today's your lucky day 😄
As in solving day 6, you mean?
well I don't want to spoil too much but: ||yes, you can solve day6 with it||
Hmm... Okay.
I did already solve day 6, but it might be nice to look at another approach, if I have some time left today.
Hey everyone, I'm stuck on day 5 part 2, my solution is to use ranges and split these ranges depending on the values, I have created tests such as:
assert test(range(80, 90), 85, 10, 1) == [range(80, 85), range(1, 6)]
assert test(range(80, 90), 70, 30, 10) == [range(20, 30)]
assert test(range(80, 90), 70, 15, 10) == [range(20, 25), range(85, 90)]
assert test(range(80, 90), 80, 10, 0) == [range(0, 10)]
assert test(range(80, 90), 81, 2, 0) == [range(80, 81), range(0, 2), range(83, 90)]
assert test(range(0, 10), 9, 10, 100) == [range(0, 9), range(100, 101)]
And they all pass, but the number I get is too low, is there any other corner case I could have missed?
The example data passes and I've traced it and everything seems to be correct there.
can you send the rest of your code?
I'll send it here, I'll just clean up the code as it's a big mess, give me a few minutes
also, we should move to #aoc-solution-hints
that one's hard 😦
My PC is still looking and counting..
day 5 part 2 is easy if you have an eternity to solve it! 😄
i should hook up my raspi and see if it can manage to solve it using my current code before december ends
And the RAM, I guess.
😮
That's the right answer! You are one gold star closer to restoring snow operations.
You have completed Day 5! You can [Shareon Twitter Mastodon] this victory or
Whoohoo.
Side note by the way, Sir Robin incorrectly tells folks that &aoc join is used to join the leaderboard, when in fact it's a slash command, /aoc join. Using the & form just throws up the help info.
So that tomorrow we can be roasted to well-done
Or to congratulations
tmrw will be an unsolved problem
Hey, I'm new to python
...that's how I did it. was there another way?
||brute-force runs in under 5s||
meh
that's a weird choice, to make the numbers that small, actually
make it even more of a "what is this day 2 task doing at day 6"
||closed-form has off by ones to worry about, brute-force is easier||
||I did an if-statement to correct the off-by-one, but yeah, it did take a bit of time||
Oh yeah I agree that the puzzle is more of a day 1/2 task than a day 6 task
Yeah - yours is the better solution but mine is easier to implement correctly and quickly 🙃
(that said, testing against the example screwed me out of several places because of an edge case in the sample that isn't in actual inputs)
Literally 14 seconds from leaderboard (p2) - less than I spent debugging that edge case in p1 :')
Just realised I'm at most the 4043rd person to get 400 stars in all of AoC (4043rd on 2016 day 25, which was my 400th star)
I'm surprised that more people haven't done it tbth
||agree, but I was still happy I could put my physics knowledge to good use||
today being so easy makes me fear tomorrow.. hell is gonna break loose
ugh, dirty link
so much for the theory that AoC is hard this year to dissuade AI usage
oof
?
well, without that theory it just seems like an unforced error
unforced error?
interesting, though I'm quite surprised day5 puzzle came before day6 because even when I could figure out the correct approach on my own and code up 90% of the solution, I still couldn't figure out the correct order of applying my functions which made me fail day5 part2, but perhaps someone with better abstract thinking had no issues figuring out the last bit of the solution
7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.
..
stop posting this large code block
:incoming_envelope: :ok_hand: applied timeout to @honest tangle until <t:1701875549:f> (10 minutes) (reason: chars spam - sent 4734 characters).
The <@&831776746206265384> have been alerted for review.
yeah, I mean I got day 5 part 2 but it was definitely a grind I thought
the algorithmic concept wasn't trivial, and the implementation was definitely not trivial to iron out all the bugs
for a day 10-15 it would be pretty typical
Brute force win every time
I was lucky in that I've seen the range concept before, but the implementation was beyond what I could imagine in my head... I'm happy for people who got it
took me a while. should have stuck with brute force 😛
I noticed that a lot of people skipped day 3 intially, that one seems harder than I'd expect an early one to be
3 wasnt so hard seeing what was in day 5 now
My Day 6 solution was also a bit brute forced, but in what I'd like to think is a slightly smarter way
I tried calculus first and gave up
day 3 and day 4 have almost same number of 2 stars.
day 5 and day 6 have almost same number of 2 stars.
in 2022, the first day to have ~46k completions was day 14
they really messed up the difficulty this year
to be fair, 2022 has had a bit more time to accumulate.
yeah day 6 hasnt even been open for 12 hours yet, of course the numbers are lower than day 6 for a year ago
idk, you think it would double by next year?
wayback machine shows these as being the stats as of around this day last year
Well give it more memory
smh why you gotta bring facts into this

anyone knows any online compiler or something with larger mem?
than an actual PC? no.
(also, calculate first how much memory you'll need, to see if it's feasible :p)
Well just these dicts which store the initial numbers and the end numbers (not the whole numbers)
I found you don't need to actually know the name of the mapping. They're all processed in order.
Well, sure, so you can estimate how big these dicts will get, multiply this by the about 80 bytes that an int-int pair inside a dict takes, and thereby estimate the memory consumption.
(||funnily enough my estimates aren't that high|| - ||only in the low hundreds of gigabytes||)
Ok thanks. Will try
isnt it just ||quadratic inequalities|| though
okay but how do you have different syntax highlight for each one
Which IDE/Editor do u use?
yoo i was wondering something was off
it’s like rainbow indents
syntax highlighting, but solely for aesthetics
cat | lolcat
vsc
i use some plugins solely built for pycharm pro. But there are some geberal one for vs code too
day6 part1 awakened the mathematician in me
only problem is that he has been sleeping for decades
xD
The data says it all lol
Day 3 and 5 make people drop like flies
Sounds like an endless loop
Or you did just a bit too much brute force
I accidentally made an endless printing loop in one of the challenge and an error similar to this appeared.
Nah not an endless loop. Works for the sample
day6? more like day0
people will say this literally every year without fail
lmao
day 6 can be solved with paper and pencil
actually justified this year though
tbf there always is one problem much easier
i don't wanna hear it from global leaderboard ova here
😔
take it from non-leaderboard 😤
||these quadratic equations are a bit rough for pen and paper||
fine, paper, pencil, and a calculator
you guys need to understand that eric doesn't care about this being a perfect climb in difficulty. Puzzles are ordered for lots of reasons, one of them including fitting in with the story. Day 6 is when we got to that boat race area, so day 6 is when we get that puzzle. Yes it may be easier than all the puzzles prior, but that doesn't matter to eric
yeye i'm not mad at him lol. i think we all get difficulty goes up and down and is also subjective. just fun to poke fun at it
lol yea no for sure. There are plenty who are legit criticizing though, which is just crazy to me. It's a single man making a christmas game for hundreds of thousands. Give the man a break lmao
does bot react on christmas in message?
yea wtf lol
lol
it reacts for tree as well
TIL
I kinda believe this is very common in software in general, we take free stuff for granted
tree
ohshit more highlight words
i mean today could have used a larger input
just enough so that brute force isn't viable
it is what it is 🤷♀️
i wrote my solution assuming that the input would be too large to brute so it ended up being fast either way
every tree is a christmas tree in december :D
i won't lie, i was surprised when my brute force finished in 5 seconds. But eric also is a merciful man, and it's likely 6 was meant as a break from the insanity that is F I V E
yea i'm scared for 7. I really need to finish up day 5 part 2 before midnight
i just bruteforced it lol
how long did that take?
and while it was crunching numbers i was thinking about optimising but it spit out an answer before I could come up with one
took about 4m30s
(in Golang)
but saw another Python bruteforce that took about 5m
i'd be curious to see that
oh anything over 30s to brute feels too icky for me to do
regardless, i'm currently trying to write a clever solution
I'd need a whole day for that so I saved it for after AoC ends
ye i have an idea for what i want my clever solution to be. but like writing it is a tad annoying and i only have so much time to work on it
ye exactly
What is AoC?
same yea. currently at work
advent of code
what is it though?
fortunately was able to do today on my break :P
#aoc-faq explains it~
ty
not too good at naming variables but here you go
Solutions to Advent of Code puzzles implemented in Go (golang) - RollingRocky360/AdventOfCode
o spent like 5 hours on it last night 💀
second most i've ever spent on a. problem
i was mentioning in my work chat whether or not i wanna spend time writing the clever solution in python or just brute it in go lol
sweet, go is a crazy language
C bruteforce took 60s as someone here said
alexandria ocasio-cortez is the representative for ny's 14th congressional district as a member of the democratic party
lol fellow new yorker enira?
I will die on the hill that AOC != AoC 😤
haha. i did think of advent of code when someone first used that abbreviation though
lol it's so hard for me not to answer with her when asked about aoc
nj
F# is based and elegant and I wish I was better at it
ahhhh
tho it did take me a while to figure out I cant have
{ 1 .. time }
if time is int | uint64
silly error messages are so cryptic
also ionide shat the bed on me today
what lalng is this
https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/units-of-measure @cyan sleet gonn use these 👀
this is actually based ngl
Yeah type systems with units are kinda cool
F#
Pretty much instant pt2 today even though i brute forced it
Yeah p2 was surprisingly small
related, units enforced by the type system is one of my favorite things to see
wrong units → compile error
kotlin was instant too
I suspect it must still be a bit annoying to implement over there since const generics are still pretty limited
in C++ it's actually somewhat straightforward (depending how many bells and whistles you go for)
it's actually being proposed for the standard library in C++, though I doubt it gets in
idk how well it works, but that seems reasonable
I love getting the wrong answer because I printed a number and assumed that was the answer. But I actually forgot to print the answer
@hidden musk F# feels like ocaml but with batteries included
day 6 was much nicer than day 5 lol
yeah
i mean my part 2 would be slow if the numbers were larger
so i could optimize that but i honestly don’t care
you could have made twists to make it a tad more interesting
I think you just need to install Core
F# is great because .net though, no denying that
right, you can make brute force infeasible to try to make people ||binary search||
i love brute forcing 😩
stuff like |> double just working
it's just so straightforward https://github.com/algmyr/aoc-2023/blob/main/day06/main.fs
though maybe i've been functionally primed now 🥴
ain't no way you wrote Delta
correct, I wrote Δ
\Delta
decided to hunker down and
holy moly. thats a lot of work. did you have fun?
only 4 days left
what
8 more stars
haha
No.
how do i get to this window?
events
ah. i've been enditing the url to change years. that does make it more pleasant
HOLY COW I COMPLETED DAY 3 PART 2 FIRST TRY
nicely done :)
p2 is not so difficult after p1; it's getting day 3 p1 done which can be tricky
hmmm i see
yup
🥴
they should be in the previews in #1047673173447020564 (well, except for the first two days)
well yeah
I could also just look at my repo
I didn't name the dirs by language, but...
i don't think i've seen a single f# job
Are you looking for one?
no the language looks sad
im gonna be honest, trying to do the minimalist approach (doing everything in as few lines as possible) is the hardest thing i've ever done
ocaml still on top for me ngl
haskell close second
of the languages we've done so far ocaml is prob my favorite
prolog takes the cake for "interesting"ness
it's probably the most unique of the bunch
Golfing is a difficult pastime
fewer lines isn't really golfing tho
one liners should always be possible here
even excluding uses of exec and stuff
for sure
that's why you don't brute force
I only brute force with small input like day 6
My laptop only has 8GB RAM so I have to be extra careful when brute forcing
Oh no I’m doing day 5 part 2
brute forced day 5 pt 2 in 5.724 seconds 😩
Noice
this is gonna have to go now
what will it be today, path finding? mini compiler? chinese remainder theorem or other modular arithmetic? game of life in 12 dimensions with sea monsters?
Language Roulette: Day 7
The language is ... Visual Basic
reminds me I shold install networkx and learn how to use it again
GL everyone
hey no esoteric languages!
🫡
COBOL tomorrow 🙃
That would rock.
That was the first programming language I ever used, VB is ... Factually speaking a language
Not as much as Rockstar being a chosen language, but still
That one elder member of the server "YES"
Is Excel on the roulette?
good luck to everyone
GLHF
The number of reddit mods here outnumbering the number of cobol devs here.
won't be able to aim for leaderboard again sadly since outside rn
vimscript would be nice
I’m tired tho, Gluck I’ll hit it in morning
I have a flight in 2 hours
emacs lisp!
Smh imagine touching grass /j

at the airport rn
You should at least look.
glhf
<@&518565788744024082> Good morning! Day 7 is ready to be attempted. View it online now at https://adventofcode.com/2023/day/7. Good luck!
I tried that before and went to bed 2 hours later 😉
...tbh this one just looks painful and boring.
There's dozens of us!
because I do not have the time to struggle with aoc
bruh
naptime
good night pub
@ripe meteor this one's for you
have a good sleb
this make brain hurt
😢
Looks like Poker
i'd rather play it in real life with a person on top of a camel
dopamine.exe
14/16
Wow GG
I should have just pushed it for p2 I was thinking 'surely this isn't fast enough'
?
(spoiler: it was and I could have sent it around 20s earlier)
was there any clever optimization?
I don't think so but it was basically instant anyway
lmao see here's the thing
I should have just pushed it immediately
||like i had a debug print printing out every comparator||
Ah
||and even with that my sol ran in time||
Yeah that will slow you down
anyways, i just ||brute forced all jokers, wbu||
Wait why did you need to debug your ||comparator|| lol
Yeah, ||combinations_with_replacement|| mvp
I should have just shipped it because ||n is at most 5 so it really isn't that bad||
i mean, ||it's always optimal to have all J's be the same value||
That's completely fair
||i was replacing one joker at a time 💀 ||
You literally just acknowledged why that isn't better lmao
well i supposed it's time to start cleaning up my code
i act up under stress idk man
could someone tell me what p2 is?
Day 7 look fun
just anytime after leaderboard fills up
||wild cards||
||how does that work?||
||they can replace any card for a better -of-a-kind|| i spose
I told him in solutions btw
i choked again
most unfortunate
I completely missed this line: ||If two hands have the same type, a second ordering rule takes effect. Start by comparing the first card in each hand.||
||I was comparing the repeated cards instead (so 25557 > 33327)||
Lol rip
advent of reading comprehension is back 😔
💀
welp that was slightly tricker than I thought ||JJJJJ||
not using ||regex|| is probably what messed me up on this
what would you need regex for?
the way i determine the value of a hand is so scuffed lol. Also part 2 is clever, seems like it'll be fun
idk just glancing over it it seemed like it would be easy to use it to find hand types quicker
Having thought about this, yeah regex could do it fairly easily. Still wouldn't be my first choice though
I think the ||counter method|| is the most straightforward
spoiler tag?
Well day 7 is the middle ground I guess?
Not hard, not easy
For the jokers dont panic, a couple more if-else would be able to handle it
Oops mb
all good!
yeah that's what i ended up going with, easiest to implement
Maybe the next one will be hard...
so whats the value of a JJJJJ hand? five of a kind? full house?
yep yep
or is it a 'high card' so the weakest hand?
or does it turn into a 'AAAAA' but its still just four of a kind?
Do yall find this one hard compared to other days?
Five of a kind
five of a kind of not a defined type though
god, it is
im blind
theres a bug somewhere, but time to work
right answer, yay
can i maybe get someone whos a pro to look over my code to check for places to improve?
isnt 33333 weaker?
no
"To balance this, J cards are now the weakest individual cards, weaker even than 2."
five of a kind (the weakest five-of-a-kind possible).
yeah, i forgot 5 of a kind was defined at the beginning
considering you dont get 5 of the same cards in a normal deck
but saw JJJJJ in my input and it confused me
ah i see
thats what ive been missing 💀💀
Fun, nobody on the subreddit used the same method than me.
I found it elegant enough.
Aid
I feel sad now because I over engineered the 2nd part.
I thought J should ||be one of the dealt cards, instead of seeing that it is just the most occurring card.||
What does it change?
I had to find all possible k combinations with replacement of n unique cards
I have the feeling I didn't face that kind of difficulty.
My way to solve this was pretty straightforward.
I just counted jokers card and added them to the score of the other cards.
Because you don't have to deal with it if you ||correctly assume jokers become the most common non-joker card||
yeah that's what I meant
do you tend to use modules or try solve it without anyting extra?
I used collections.Counter but you can do it without.
yeah it is really powerful in this case
so far ive used no imports
although maybe i should start using them, i feel like im not learning anything from this
To be fair, Python builtins are already powerful enough.
Ever get it when your solution works on the test input but not the whole data
Yup. Been there.
That's my main issue with day 3.
Today (part 1): When the hand variations are explained, what does this one mean:
High card, where all cards' labels are distinct: 23456
Does it mean all labels should be different? Or should it be in some series, like 23456 is? Thanks
Thanks :)
Could anyone run their solution on my test input and tell me how many hands get sorted into the 7 different types?
1 93 100 173 171 261 201 is my types supposedly where the 1 is 5 of a kind and it goes down respectively
Anyone know of a good discord bot for a private leaderboard?
I've given up on this all together, dear lord it's hard
which day?
I believe I stopped day 2 part 2 or maybe day 3 idr
yeah day 3 is fiddly. took way too long but I had fun. have you considered #aoc-solution-hints ?
It's not that it's just that the way it's explained is confusing and I have no idea where I would even start
can I give a slight hint?
Sure
- ||put your input in a nested list so that each character has its own coordinates||
2.||get a list with only the numbers||
This is day 3?
Nw I'm still on day 2 part 1 lol
no its right
Just checked
That's for day 2 right?
Ah
did you process your input already?
Like get my input data?
yes and put it in a list where you have your values seperated
That should be easy enough, I've done it before
😓
128 pixels meme
can I do vb.net
🥺
wjhar 💀
yeah?
Yeah that's fine lol
where is the code golfing section for advent?
isn't vb just the new name for vb.net?
Visual Basic (VB), originally called Visual Basic .NET (VB.NET)
they have different runtimes
oh they call them the same thing now?
it feels like cheating because .net is so based though
Do it in excel or else
excel is surprisingly good at AOC
indeed
VBA
that's a different thing 🥴
basically the same thing
nah
Well excel can be used to solve certain problems
For more complicated ones, its faster and easier to just write code, unless you are really adept in excel
and what's that
Did anyone post an Excel solution for day 7? Or even VB?
Im doing day6 part one. Id like to verify my understanding of the task so far. I am supposed to move up all cards of the same rank with the secondary rule. This would mean that every rank execept for the last rank has only one member?
Card? You mean day 7?
6 was the races
the secondary rule applies within-rank, not between ranks
if I have '4444T' and '4444K', they are both in the rank with 4 of the same number, but then I need to sort them based on highest unique card within that rank
Yes sorry, had a long day 😅
Maybe open a thread over in the hints channel?
maybe later
just realized one of my earlier code might be useful here. does the order matter?
Is it just me or do the AoC problems this year come with a lot less useful test data? I keep having situations where my code works for the test data but not the real data and I think it's happening more than in previous years
It's hard to tell if this is an intentional change or not, but I'm finding it a bit more frustrating this way
I found that happened a lot in previous years as well. This year seems ok so far. You could always add more test cases to your example input I suppose.
I think it's pretty much the same as always too, fwiw
the test data is good for basic sanity checking, but every year there's generally at least one day, often several, where at some point I'm failing on the input but succeeding on the test
some edge cases just don't show up in the test, it's always been like that
I do like that quite a few problems can just be checked by hand, its just compute a thing for each row.
One thing i will say is that for a lot of days, he really walks through how the test data translates into the solution, step by step
for example, he might give the value for every row for a row based problems. Or for day 5, he explained every single step of the mapping
So when you write unit tests based on the test input, you don't have to write a single unit test that just does the same thing as running the whole problem
im still on the first day is it too late for me 💀
you can have much more fine grained unit tests. that helped me a lot when I was trying to get the optimized solution for day 5.
there is no time limit
also you don't need to do previous days
i was put up to this by some sysadmin friends the first challenge looks easy enough. is this something you guys put on your resume?
you can just jump to day 7
it doesnt get harder?
though do keep in mind they get more challenging
ah
nah a friend started today as well
and skip day5? 😄
best part!
you can add anything. though idk if resume would be best. you can definitely put your solutions on a repo and put the link to your github or something on your resume
ah. How are we faring? no spoilers i wanna do this on my own
bad, good, bad, meh, terrible, great, good
6 was great?
why such randomised difficulties
6 was boring
true
I was thinking in terms of difficulty for me
I didn't write even proper code for 6
too bad you could ||bruteforce the thing in under a second||
APL can invert functions, so it was truly trivial.
APL?
a weird language I am learning for this AOC
alien programming language
APL stands for A Programming Language 😄
If I wanted to make my own language to get my own syntax what would it take?
like what do I need to learn
the first sentence on its wiki page is practically "APL (a programming language) is a programming language...", i love it
I could use hell lot of macros in c++ ig but maybe could get a lang. of my own lol
https://craftinginterpreters.com/ is the best resource I know of
i coded the entire solution assuming go's regex package supports backrefering.... it doesn't
this hurts
I just signed for the first time(so I'm new to this) into the advent of code and completed part one of day 1.
But I just don't know how to do the part 2 in python.
I would really appreciate any help.
Thank you!
Ask over in #aoc-solution-hints , no spoilers here 🙂
you can make a functools-type compare function, or a function that just returns something that sorts like the cards
"just" a custom comparator: there are details to get right inside that comparator
edge cases in part 1 or part 2?
Part 2
aah, ic
have fun with that :P
how did you solve part 1? i think certain solutions to part 1 end up with much easier/more difficult solutions to part 2
Implemented a comparator and a bunch of str.replaces to make sorting easier
this might cause you trouble in part2
oh i shouldnt haved used the word just
My two solutions are pretty similar, i just hadnt considered ||JJJJJ|| and ||J dominant|| inputs
but what i meant was, that the solution is a custom sort function
the difficult part would probably be checking what type of hand you have
I get that part of the puzzle is to figure out other edge cases but i hate it all the same 💀
part 2 is edge case handling
spoiler :||or you could just insert every possible card for j and choose the strongest||
that's what i did
another spoiler: ||but if every of the 1k hands had 5 js, then youd have 14^5 * 10^3||
ran instantly
would spoiler this btw
what i did was j ||if there's more than one j, j assume all the J's will be the same||
One thing you should check is: || whether there are any duplicate hands ||
