#advent-of-code
1 messages ยท Page 13 of 1
legend
Congrats!!! It's way harder to get LB now than it was when I started, so that's really cool!
oliver still gapping me though ๐ฆ
Oliver insane

i think i spent the longest on the parse
re go boom
who even is oliver
This should have been the day 1 puzzle. ๐
^
requiring a parsing change for part 2 is nasty and definitely not day 1 material
||(\d+) (\w+)|| isn't too bad tbh
I mean tbth I just hardcoded in the specific cases
That might be useful for the golf though
people changed their parse on this one?
No for day 1
I screwed up by not noticing the 13 changed to a 12 for the input data
Ooops lmao
tyyyy!!! this is like my 5th year doing these (3rd year competitively), so i'm really happy to have finally managed to do it
congrats
nice
It's amazing how little a difference there is between top 100 and top 2000. Getting to the top is really going to be a challenge for anyone not pushing for it. Well done.
at least i didn't do bad in p2 this time
wow, man i got held up on p1 for no reason
I spent abt 10 min on part one bro i need practice
was it the 12/13 change?
Of course, I am attempting everything in Haskell
||i was summing all the cubes per game, instead of accounting for each set individually||
how much difference is there?
i'm curious
there was like a 3 minute difference between 100 and 300 for day 1 part 2
which is a lot
day 1 part 2 was an anomaly tho
true
today's back to normal difficulty
thankfully i didn't throw
now go golf
I spent an extra 10 minutes on Part 1, because I ||accidentally only got the first digit of the game ID||...
AAAAAAA
Is it fine if I skip a few days? Iโm on vacation for this weekend
Like, are they required for the next puzzles?
No, previous day's aren't required
Thanks!
it's ok to skip problems, it just won't be great for your score ๐
Did it again in Rust. I suspect I would have done it a lot faster had I access to python's ||collections.Counter||. They have ||>= and | || which would have trivialized a bunch of code I spent writing. Eh, made it anyway.

fr i skipped the first few days last year and i got completely screwed on this server's leaderboards
Rust ๐
hmm why was today easier than yesterday
Usually not required, but there are some occasions where solution for one problem builds on previous one (e.g. 2019 intcode) or is an extention of a previous day's. I'm going to be in the same situation and intend to fulfil the backlog on my own time.
honestly I'm still mad about yesterday's examples.
well they are required for day 25 part 2
Ohโฆ
yeah
Dang
well, yes, but that's not really a puzzle
Time to speedrun next week
that's just a reward for having completed all the other 49 puzzles
fair enough
well day 25 2nd star
the 9 minutes delay was horrifying
9 minutes delay?
the time between day 2 starting and me noticing
true
yeah completely locked you out of both boards ๐ญ
ballmer peak was not necessary, but it's a friday night :D
You don't have to do them in order, or complete them the day they're released. I'll be happy if I get all 50 stars by the end of La Befana (12 days after Christmas) local time.
i got 20 and 25 minutes though
so it's not like the 9 minute delay was significant
since just solving p1 took me 11
๐
LOL
but-
but that's supposed to be runtime, not coding time ;-;
anyway golfing time
why do i always make the odd decision to write tons of bugs into my code
Some of us have coding as a hobby, and some of us havee debuging as a hobby.
It's like sculpting, you remove everything that isn't the thing you're trying to sculpt. ๐
heh
right there with you ๐ป
(I started a beer about 20 min before the puzzle dropped)
I made a G&T after finishing it ๐
nice
skill issues
you're not wrong
Man that was way easier than day 1 lol
while True:
print('I'm brainfucked')
I had some fun w/ sets
I think you mean +[I'm not writing the code here it would be way too long]
๐ ๐
yea brainfuck actually brainfucks you
Yeah, today was easier than yesterday's part2. A good chunk of my time was spent on input parsing I think (wonder if I should bite the bullet and learn regex).
You converted me lol, it's pretty nice
๐
I like the separate function for parsing input
I mean the best part is clearly the auto tests lol
I mean not really, you can just have assert result is <answer> lol, had that before
He co-wrote early versions of aoc_helper, but I've been maintaining it solo for like 2 years lol
Yeah but auto tests, it pulls them out of the webpage
Not currently
gh issue time lol
Lmao
It's totally doable but I like viewing it in a browser because you can user-style the important bits of the page
(I did that, they now glow yellow instead of white)
imo yday's part 2 wasn't as much hard as much as it was poorly written; if they had emphasized in the text that, for example, EIGHTHREE should return 83, then that would've cleared up a lot of confusion
You are not allowed to use that command here. Please use the #aoc-bot-commands, #sir-lancebot-playground, #bot-commands channel(s) instead.
In OCaml?
I quit
I did the Python, I'll do language learning.... sometime that's not 2am
ok, I spent way too much time cleaning up code rather than just solving part 2
in any case, done
now to clean up this absolute mess...
What is the name of the private leaderboard?
why is part 2 of day 1 ridiculously hard
it was an interesting decision for sure
it says my input was too high, i cant figure out what went wrong since im going through it now, still no errors in gap of judgement
have you tested these edge cases ||```
twoneight
nineighttwo
5eightwo
`28`, `92`, and `52` and totals to `172`||
im using regex so it should detect it fine
ill test it tho still
it seems to not be able to detect those type of things, maybe thats the issue
idk how to fix it tho
- do not use
.findall()
.finditer() too
what would u suggest then? cause idk what other thing would help with keeping them in the order they appear?
continue in #aoc-solution-hints
I have a solution to puzzle 1 written in brainfuck. Any recommendations on where to post it?
day 2 is confusing how it is written
too much words, aye?
its hard to understand it
how can i connect my discord to aoc
so that i can get that fancy colored name in here?
for example ```
the ID of the game
|
| set 1 set 3
V _____________ _______
Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green
----------------------
set 2
each set is separated by a semicolon (;)
each set has a specific format, example for set 1...
number of cubes...
| ...blue cubes
V vvvv
3 blue, 4 red
^ ^^^
number of red cubes
with each type of cube (red, green, or blue) distinguished with a comma (,)
this is still super confusing, might be cause im sleep deprived, 4am with no sleep go brrrr
have to find the games that can use only 12 red cubes, 13 green cubes, and 14 blue cubes
each game format is different though with each set, idk how i would manage to use that
||so basically check each color of cube in that set and the compare that number for its limit ```
game 1 is okay because...
game ID
| set 1 set 3
V _____________ _______
Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green
----------------------
set 2
set 1:
3 blue, 4 red
^ ^^^^
the limit for blue cubes is 14
3 < 14, so that's okay
3 blue, 4 red
^ ^^^
the limit for red cubes is 12
4 < 12, so that's okay
set 2:
1 red, 2 green, 6 blue
^ ^^^
1 < 12, okay
1 red, 2 green, 6 blue
^ ^^^^^
the limit for green cubes is 13
2 < 13, okay
1 red, 2 green, 6 blue
^ ^^^^
6 < 14, okay
and so on for set 3...
each game is filtered like that
|| so i need to check if the cube amount is under the amount allowed and if it meets that for all sets then its a possible game? ||
||yes||
gonna be a pain
guys i don't understand aoc puzzles, what should i practice bforehand to solve them?
reading
you mean i improve my vocab?
sure? whatever helps you understand the problem statement better
its puzzles are weird tbh
hmm no i guess
AOC questions are usually purposefully pretty multi-disciplinary, but there's a bit of a focus particularly on DSA stuff and the parsing of input (e.g. today's challenge has a big focus on parsing input textual data into a more useful representation)
whats DSA?
data structures and algorithms
oh
i suppose there's a bit of overlap with the things AoC asks of you and the things that a competitive programming contest would ask of you
i guess i need to practise for 1 year more
there's always previous years' questions to practice on too, especially the ones on the first few days of december
For Day 2, Part 1, is it just if total Game's red > 12, total blue > 13, total green > 14 then it's impossible?
no , i mean ill practise python concepts more
yeah, if at any point more than those limits are pulled out at once, then that game wouldn't have been possible
okay because in the sample info they split it into sets and that confused me lol
thank you
yes each set should not exced these numbers
not the sum of colors of all game
how do i know what to split into sets then?
what determines a set?
by >> ;
the sets are delimited using ;s
in the context of the sorta AOC world, its like in the example game 1:||
- The elf grabs some cubes, and shows them to you: 3 blue cubes, and 4 red cubes
- The elf puts the cubes back in the bag, and then shows you 1 red cube, 2 greens, and 6 blues
- The elf throws the cubes back in again, and pulls out their final hand: 2 green cubes||
๐
funny how in day 2 on part 1 i spent like 30mins but on part 2 it was not even 5mins ๐ญ
parsing problems do be like that
guis
is this good code?
def is_game_possbile(input: str):
input = input.split(';')
input[0] = input[0].split(":")[1].lstrip()
red_array = []
green_array = []
blue_array = []
for i in input:
for j in i.split(','):
if "red" in j:
red_array.append(int(j.split()[0].lstrip().rstrip()))
elif "green" in j:
green_array.append(int(j.split()[0].lstrip().rstrip()))
else:
blue_array.append(int(j.split()[0].lstrip().rstrip()))
red_array.sort()
green_array.sort()
blue_array.sort()
return red_array[len(red_array)-1] * green_array[len(green_array) - 1] * blue_array[len(blue_array) - 1]
this thing works correctly
your function starts with is_ which should imply that it returns a boolean
but looking at the return statement, i'm not sure if that's the case
how fortuitous that i already planned to do ocaml this year and half set it up already
but ik that this thing works
i forgor to change the function name though
i edited 2.1's code
.lstrip().rstrip() can be replaced with .strip()
Just sat down to try my hand at day two, am not even properly understanding the question
Off to a great start
ahh ok
What is lstrip and r strip
!d str.lstrip
str.lstrip([chars])```
Return a copy of the string with leading characters removed. The *chars* argument is a string specifying the set of characters to be removed. If omitted or `None`, the *chars* argument defaults to removing whitespace. The *chars* argument is not a prefix; rather, all combinations of its values are stripped:
```py
>>> ' spacious '.lstrip()
'spacious '
>>> 'www.example.com'.lstrip('cmowz.')
'example.com'
``` See [`str.removeprefix()`](https://docs.python.org/3/library/stdtypes.html#str.removeprefix) for a method that will remove a single prefix string rather than all of a set of characters. For example...
rstrip literally the same but for right side
Does day 2.2 still work with impossible games or is that part not used anymore
it's not used
Alright thanks
there's str.rjust, or you could use the f-string format spec
Hi! I think theres something wrong with my AoC input for day 1. The task states I need to combine the first and last digit of each line - however, on line 5 of my input I have the string zphgdcznqsm2 which only has 1 digit (2) at the end.
Am I missing something here?
The newly-improved calibration document consists of lines of text; each line originally contained a specific calibration value that the Elves now need to recover. On each line, the calibration value can be found by combining the first digit and the last digit (in that order) to form a single two-digit number.
Well, what's the last item in a one element list.
check the last line in the example input (||treb7uchet becomes 77||)
Who has done day 2 advent of code?
||```py
sum = 0
with open('day1.txt') as puzzle_file:
for line in puzzle_file:
numbers = [num for num in line.strip() if num.isdigit()]
if len(numbers) == 1:
sum += int(numbers[0])*11
else:
sum += int(''.join(numbers[::len(numbers)-1]))
Done! Anyone done a 1-liner for day 1? ๐
๐ญ๐ญ๐ญ
wait until this guy find out about part 2 ๐ญ๐โโ
Ahh, no biggie - just gonna use a dict for conversions
nuh uh
eightwone is expected to return 81
i somehow managed to solve this in 32 lines ๐
now i wonder, what is the shortest possible way to get the solution without using semicolons
yes
it works with the general .replace() approach
Yeah..?
a more not great test case would be 5twone which should return 51
Just need to ||replace all instances of words -> numbers, you can use a dictonary for the mappings||
good luck with that approach
||5twone should equal 521/5tw1, not 52ne||
||7oneight should equal 718/7on8, not 71ight||
Yup, I read the examples given ๐
can someone explain why my code is working but failing
it works on the base case
it gets me the right games
and adds their IDs
yet its wrong
you shouldn't add the numbers together
that's the problem in your code
Seriously?
Determine which games would have been possible if the bag had been loaded with only 12 red cubes, 13 green cubes, and 14 blue cubes. What is the sum of the IDs of those games?
sum of IDs is okay
sum of reds, no
sum of greens, no
sum of blues, no
they're each separately compared to the 12/13/14 count
ok
if r>12 or g>13 or b>14 then it's invalid
Game 101: 6 red, 7 blue; 5 green, 9 blue, 7 red; 9 green, 2 red
``` this should be a valid game
See #1180008645384216606 for the golfing
Thank you!
Can I get advent of code for actual morons?
๐คจ
my one liner passed fiddle code review
well i'm counting one liner as after the file.read().splitlines() in the parser
oneline golfing is pretty cool though
i'm meh on it
i like regular golfing, and i like eval golfing (has to be an expression) but for some reason just that not interested in one line golfs
I have two of these and they've been fantastic
Hey guys, I need some push to get started. Fear of failure is keeping me back
It always happen when I start something from scratch
Fear of failure for AoC? Failure to do what though, get on the leaderboard? Solve the puzzles?
Everything, literally everything but more so solving the puzzles themselves.
Just a matter of perspective. If your focus is to learn things (and maybe even have fun ๐ ) rather than "winning", then you basically can't fail. I've been coding for 10+ years and still managed to learn something day 1 ๐ that's a win in my book. Even though I got a horrible time. But yeah, use the community, ask stuff, keep learning
Yeah really there's nothing to lose by doing the puzzles.
And hey, the leaderboard top 10 is pretty darn hard to get on to
by the time you're good enough to get on the leaderboard you've definitely gotten rolled enough times anyway
I will get started with day 1, I will report it back here. I wanna have fun. I love the fact that strangers from all around the world are just focused on this one event
strangers around the world that are focused on this event are focused on this event
๐
Don't be afraid to ask for help if you get stuck. All about learning
@modern terrace #1180009538544488478 message
Finally did it, you were right in saying about those edge like cases!
Appreicate the help
I tottaly forgot about regex.... 
eh
1 year of getting rolled isn't that much
though i'll probably fall off the board once i can't yolo things
you say this every time and then still leaderboard 
i only leaderboarded like 4 times last year
and those were not even high leaderboard
you weren't there at the start everyday last year
true
talking about day1 p2?
about today
ah
but i feel humbled by someone with about 10 lines of code 
i find part 1 harder than part 2 haha
well this is my solution for today ||https://github.com/DownDev/advent-of-code/blob/main/2023/02-2.py||
Does anybody know how would i add my repo here? https://github.com/Bogdanp/awesome-advent-of-code/
It seems a little bit confusing to me as never contributed to something
https://github.com/Bogdanp/awesome-advent-of-code/pulls
open a pull request
lol, for me in day 1 part 2 it was a little bit weird because of the: "twone, eightwo"
I did
I dont know if i did everything correct to be honest
It got added YES
All fine thanks
wow today was way easier than yesterday
yeesh. I'm way behind on my private leaderboards because of timezones
central time to pacific time
actually you could probably go west to idl and still have a good timezone
Is this a place to ask for help with AoC/
I could literally solve the day 2 - part 1 without coding but it would take a lot of time
It was easy
Here is my attempt for day 1 part 2 but it's too low. Anyone know where I've gone wrong?
||https://hastebin.com/share/revevoxuzo.python||
||if you break after checking if one is before the first digit, then it fails if there's like an eight before that, so for example on the input 'eightone1', ||
||also you're off by one for enumerating nums since enumerate starts at index 0||
if you wanna discuss further i'd recommend moving to #aoc-solution-hints
||also no 8||
For day 2 part 2, you should only calculate for the games you kept after part 1 or for the entire input?
the example input makes this clear :)
it does! thank you!
Advent of Code is partly Advent of Reading Comprehension... until even reading doesn't help lol ||cough cough day 1||
that's a story right there
the new type of comprehension
we have list comps, set comps, dict comps, gen exprs, and now read comps
Too much time on their hands and not enough brain cells
the n word thing or aoc?
n word thing obviously
if you're a beginner i'd say start with ``print('Hello, World!')` first
on a serious note, if you do mean aoc, i'd say give it a try, and if you can't then come back to it later/look at other people's solutions for some insight
tho this year's day 1 is a bit hostile so maybe skip to day 2
nah that's mid
do exec(bytes(ord(c)%i+32for c in'๑ณชช๒ณด๑ตฆ๒
ข๓
๑ถ๑ฏ๒ฆ'for i in b'efg'))

is there no way to get rid of that +32 by using higher ord bytes and different unicode values
so for some reason I had a rule that both parts of my solution would be standalone, and I've already broken it in day2 
can we not go full esoteric while beginners are watching
fair enough
hi
Hello, is 54431 close to the result of challenge 1?
how do i sign up for aoc?
Go to aoc-faq channel just below
different people get different inputs
did you find that somewhere or do people really make these themsevles
This challenge shouldn't have been that hard... I'm scratching my head here
I tried checking them one by one to see where the error was but my eyes gave out after the 50th
And there are 950 more to check ๐
hm okay so how does this work, im on the aoc website i clicked on the first puzzle, what do i do?
ff6dhvzmdrgt should be 66 right?
You must login using one of the authentication methods
Then read through the puzzles and solve them
||yup||
woah the puzzles are more of an english challenge than a programming one
real
Could I post a file containing my input and the number I found here and ask someone who is willing to check where my mistake was? Checking 1000 entries one by one manually is just... my eyes are spinning haha...
Format will be:
entry1:num1
entry2:num2
For example:
jninepzpgtzq7four5:95
fourvjjrttlvdtfour8qxdvlg22two:42
how do y'all structure your environment for the aoc puzzles?
just input.txt file and python file
poetry for dependency management, have my own scripts for pulling inputs, challenge texts, and examples at midnight
automated submission as well
then shortly before the thing drops i copy a template
so do you make a folder like that for every day?
How about if you just post your code and I check it against my input? Then I can give you either a hint, or the line that was bad
not really
Probably donโt post your code here though - do it in #aoc-solution-hints
so how u do it
im working in the same folder each day
Woah
so u dont even save the previous solutions?
i do, i also save them to github
a few seconds matter a lot for the first few days
so you make a repo for each day?
he just uses commit history to see previous code fr
so how do i automate getting the input?
imagine
well i saw people use some libraries
!pip aoc-lube
!pip aoc-helper
:P
same ๐
!pip aocd is a thing too
requests.get(f"https://adventofcode.com/{YEAR}/day/{DAY}/input", cookies={"session": AOC_SESSION})
What does exacltly go in : "AOC_SESSION"
your aoc session token
beep bop (session cookie)
Yes! ๐
Thanks!
is it normal that the page looks like this? I've seen it being an actual christmas tree somewhere
Hmm, do you guys also think that day2 is easier than day 1?
Yes
Day1 part 2 was a bit janky, I had to debug my code a lot until it worked
Day 2 I blew right through without even debugging lol
Calendar art is different each year and is unlocked by solving puzzles
the picture fills in more each day
Yeah if you solve day 2, it will change a bit
Tree was 2015 btw
Oh day 1 was a trebuchet lol
I only noticed it just now
And day 2 is a floating island I guess?
most definitely
idk
depends
managed to do both
needed some help figuring out how to parse a string
but i had the logic on lock
day 1b had the edge case with overlapping words
day 2 doesn't really seem to have any edge cases that caught a lot of people
Not really, parse part 1 right and you got part 2
Can't tell if you're contradicting me or agreeing with me ๐
Looks like they're concurring
Agreeing lol
Not really refering to "any edge cases that caught a lot of people"
There is a bug in today's page:
<li>Game 2 could have been played with a minimum of 1 red, 3 green, and 4 blue cubes.<li>
This is right?
what exactly is the bug?
unmatched <li> tag
(that's actually just how HTML works)
Oh wait yeah no it creates an empty li lmao
I mean I'm pretty sure browsers will just ignore it Nope it's just that game 3 renders over it lmao
Damnit Eric
(BS4 doesn't understand it lmao)
can someone go pester him to fix it
why are you trying to bs4 it in first place xD
Someone asked for 'read the puzzle in the console' as part of my library so I'm adding that
I thought I managed earlier but I forgot lists lol
Hey, I need some help with a relatively simple python program and im willing to pay anyone who can make it right now, dm me if youre interested
!rule 9 6 no paid, but you can get free help in #python-discussion
6. Do not post unapproved advertising.
9. Do not offer or ask for paid work of any kind.
For part 1 of day 2 is the format it's using sets or lists??
I'm confused
because if it's sets then indexing won't work
neither?
the "format" it gives you is just plain text, you have to parse it yourself, and it's up to you to determine whenever you'll want to parse it as tuples, lists, sets, dictionaries etc.
@hallow birch I fixed the console reader to actually render lists now, you should update if you want to use that
If anyone wants to see where they are globally if you've gotten points for being in the top 100 but arent in the main 100 overall here you go.
https://github.com/SaiMonYo/Global-Leaderboard-AOC
You can show multiple rules at once through the bot ? Thatโs pretty cool
i finally understood aoc 21 day 22 (reactor reboot)
coding it in python tomorrow
my redemption after 2 years
This is my nightmare day
Easily the worst day for me of recent Advent of Code
I hate 3D puzzles as I can never visualise them, but when paired with a solution that passes example but not real input, and numbers so large that debugging is nigh impossibleโฆ Yup, I failed this one HARD
Did a little catchup for Rust but now we're all good
Grrr. Part 2 of day 2 might not be possible with spreadsheets
Maybe I'll try to find a way to find a maximum with regex
Anything repeating is generally a problem
I'm trying to complete old puzzles and I'm failing 2019 day 22 part 1. My code works for the sample inputs but not the actual input, and I can't find hints online (only solutions). Can someone help me with this?
does it needs to be reproducible and work for any input, or can you do some manual steps?
Manual steps are fine I think. But I'd rather keep them to a minimum
you can probably solve it using a pivot table
Never mind - I misread it, thought it was asking for cards[2019], was asking for cards.index(2019). All that time trying to figure out why my algorithm was wrong.
How long will this be open for after the 25th?
define "this"
The advent of code days, the ability to do them?
Until the owner dies and stops being able to pay for the server? You can still access the oldest ones in the archives.
forever, maybe
You can? Dang thought it was unavailable after the 25th coolio
What year was the first one done?
even after the sun dies?
maybe
damn
Almost 10 years
Next year will be 9
If you ocpmlete a problem over 24 hours after it comes out, your time is just listed as >24h instead of your actual time. Aside from that, you can complete them whenever.
im trying to do aoc in kotlin
i was stuck on day 1 part two for a good 30 minutes ๐ญ
oh my god
Yah. That nearly ended me.
for me it was j coding the ||finding the digits as words from the start and end when they were combined bc i tried replacing the words w their digits||
i had to use regex and im def not proud of my solution
Yeah I did that too.
I want to do one in piet but there is no way I'm doing day 1 part 2
But I'm glad everyone else struggled as well I nearly had a stroke.
i think my worst day in 2021 was the beacon scanner
Was that with the grid?
i'm pretty sure that day took me 6 hours
yeah i think so
the one w the different 3D scanners
tempted to otn oneightwo
twone
twoneight
This is my first yearโฆ how much harder does this get???
uhm get ready for 2d array's around day 5
the first day is usually not this hard honestly
I really like the rocket fuel one
!otn a oneightwo
:ok_hand: Added oneightwo to the names list.
A lot
Check out last yearโs last problem: https://adventofcode.com/2022/day/25
Thank
i think it peaks around day 18-20?
usually they don't make it as hard on day 25 bcs it's christmas
I should give part two of day 1 a shot, it looks like everyone had โข๏ธ*f*u*n*โข๏ธ with it
Why did you skip it?
It actually was quite fun, just a good โneed to think about whatโs going wrongโ type problem
(How well do you know Kotlin?)
i can code most things in it
I did a ctrl+f to see if my hunch was right then I called it good. I didn't have time and I have an old textbook that I want to use on it
Well fuck
like i can code everything if i search some things up
i'd say im pretty comfortable with it
I actually accidentally completely skipped all of the edge cases with my original implementation
im gonna attempt day 2 rn
Good luck!
i would've been so happy to do day 2 in python
looks like u could use ||match/case|| so the it
with*
(No one is stopping you)
I did
Let me know you wanna see
What are you using @woven sable?
For day 1 puzzle 2, my code works perfectly for the examples, but it says I'm getting a too low value for the real data. Anyone knows about some common issues people run into on that question?
||oneight should be 18||
kotlin
ty!
what does math.prod do?
i might try day 2 using ||classes||
It seems to be parsing that correctly too
I don't think there were any other edge cases
Returns the product of multiplying every number in the list that you give it
Hmmm, strange. Maybe it's not a logic bug then, but just me being horrible at writing groovy code
Should be a build-in feature
ohh
It can also be ||frontloaded||
i.e., ||twone is 21||
math.prod(iterable, *, start=1)```
Calculate the product of all the elements in the input *iterable*. The default *start* value for the product is `1`.
When the iterable is empty, return the start value. This function is intended specifically for use with numeric values and may reject non-numeric types.
New in version 3.8.
Stdlib is close enough tbh
also ||eightwothree should be 8wo3 or 823 however u did it|| but i'm sure u alr know that
Yep yep, that's working like it should. ||"twone" gives 21||
Yeah I meant not stdlib
Yeah fair ig
It's pretty niche so adding it as a builtin would just be bloat
I've given up on this year so imma start at 2015 and move up lol
But sum is the same
How far did you get?
Sum gets a lot more use than prod

On this year or 2015?
This year
Was just curious how far you got before you gave up
Day 2 part 1, Day 3 ain't out yet so
Kotlinโฆ my daily new language lol
Oh
Okay, youโre getting it
Howโre you liking it?
Getting what?
I wanted to do this year in Agda but Agda doesnโt have any decent IDE tooling ๐ฉ
So?????
REAL programmers use ed
Who needs to see their file while theyโre editing it????

Ah
At work Iโm rebuilding a Spring app and Iโm rewriting the Java to Kotlin
Itโs been nice
Getting the problems done
Getting things solved
When you said you gave up I thought you were still on like d1p1
But youโve got almost everything so far solved
Idk where to start for day 2 that's the issue, ik what to do for it idk how to implement it is the thing, so ik the theory, not the practice ig
Waitโฆ are we not supposed to research methods on Google?
You just need to get the answer with any means other than chatgpt or other ai I think
Phew ๐ฎโ๐จ
you can google as much as you want
You're free to use it after the leadboard has been filled up.
I rewrote the logic to be less messy, and now it works
Time for some OCaml
Ah, mk
this was the day i gave up on aoc 21 lol
3D is super hard, but for me it's also incredibly satisfying
esp after having learned some basic CAD for an intro tech design class
i read up on quite the elegant solution for day 22
i was overthinking this whole time
no splitting cuboids needed :D
day 2 was sm fun w kotlin
i got lucky bc the approach i took for part one was ||finding the max amount of cubes drawn frok all the turns w each color|| so part two was easy
oh it's not my daily
i use it for robotics mainly
my daily is fs python i love python
j exploring new languages w aoc since i've already gotten all 50 stars once
Same, same
What in the name ofโฆ.
how many hecking repos do you have??
Iโm curious to look at the other languages
i'm challenging myself to use a non-generic language to do the AoC
it put emacs shortcuts in my vscode ๐ฉ
have you looked at the daily language roulette
no
AoC in PowerPoint?
at least it wasnโt vim
itโs a random language from a pool for every day youโre challenged to do the puzzle in ๐ yesterday it was groovy, today itโs ocaml
where's the roulette
I'm doing it in G'MIC. i posted my solution for part one of day 2, but as soon as i see part 2, i decided to rewrite the solution.
wdym by a non generic language
It's announced each day, and pinned both here and in the spoiler thread
itโs pinned in the thread every day
see above. i'm doing it in G'MIC. a language specifically designed for creating/editing raster graphics images.
Announced in this channel like 10 minutes before the timer unlocks
That is quite a challenge, nice!
Day 1 is missing the pin
ah, I see
I think itโs funny that Ocaml describes itself as โindustrial-strengthโ
it's used by like 2 companies at least
Yes
Which two?
semgrep, jane street
Anyone important?
me
&aoc c
Day 3 starts <t:1701579600:R>.
Got in right under the wire!!
i learn a new language every time i do aoc, shit's crazy
the beta testers did
looks like I can't make it today either 

its currenty 4:30 AM. Do I push through and try to solve day 3 before bed or sleep and work on it tomorrow
well
today
just sleep
Nearly missed waking up for today lmao, luckily I'm up now
Language Roulette: Day 3
The language is ... Haskell
some people are going to have a field day today
oh no
my time has come
๐
haskell is fun
deciding whether to do this problem now is going to depend on how hard the parsing is :(
skill issue tbh
but theres a readFile function
10 seconds...

<@&518565788744024082> Good morning! Day 3 is ready to be attempted. View it online now at https://adventofcode.com/2023/day/3. Good luck!
...yep we have some parsing work, this is a tomorrow me thing
ayy
i'm a bit surprised language roulette isn't automated lol
yikes
tf is with aoc and parsing this year
good morning ๐ญ
ok this one is need time XD
we all read the problem and decided to go to bed
11.5 minutes, on day 3
fuck i was scrolling reddit and didn't see the time
i should've seen the timestamp on my discord message
day 3 is... not ok
doesn't seem that hard tbh
its making my brain rot
though i get the feeling that these are intentionally designed to be difficult for gpt to do
i was watching owc ๐
I'm dumb
can't figure it out
I spent like 10 minutes on what turned out to be a name shadowing error
in the middle of solving day2 I realised I have an unnecessary third nested loop in my day1 solution (that just didn't affect the day1 result). have to be really sure these numbers are adjacent, y'know?
Lmao
man imagine the amount of effort required to create these puzzles
I dozed off; how is day three? hard?
a little, yes
yea its more annoying to process the input than hard
Depending, I'll go straight to bed and leave that for tomorrow me
Well, that's for tomorrow me to solve
Nighty night
about the same as day2, IMO, and way easier than day1 ๐ฅด

why did they mess up the difficulty lol
I'm tempted to peek at it
day 1 just needed better examples
But if I do, I'm solving it
it really wouldn't have been bad if the examples had properly covered the edge cases
i used another method (without any replacement) and i didnt face any issues because of the overlapping text, so ig its easy/hard depending on the method
yeah, that's fair. technically the day1 example does have the problematic case, but it doesn't spell it out in the text, so you have to notice it (which is a hard thing to do when skimming the text as fast as possible)
it points out what the problematic case is, but it doesn't tell you how to handle it
yeah, that's true
there isn't an example where ||the rightmost digit is part of an overlap||
(in fact, it's never used at all)
The thing I disliked about 1 was that ||you had to change your parse for part 2, rather than your logic||
That's less fun IMO
well tbf the ||parsing is the logic here||
Ig
i should really take the time to add stuff to my template
like a grid would've been really nice to have
with stuff for finding neighbors
bruh i had a dumb bug for problem 1 today
because
||file.readlines() includes the \n after every line||
yeah i've written for dx, dy in product(range(-1, 2), repeat=2) and for dx, dy in (-1, -1), (-1, 0), (-1, 1), (0, -1), (0, 1), (1, -1), (1, 0), (1, 1) far too many times lol
so like file.readlines() != file.read().splitlines()
i'm never using file.readlines() ever again
i use 2 arrays
and a for loop for it
imo it's cleaner
time to go back to sleep
ah i prefer the product
when i'm writing it i'm usually already like 4 levels of indentation deep and every bit helps lol
then again last year itertools became the hammer i've struck far too many nails with
i never use it, yeah. it gives raw lines, with the newlines at the end.
Took me a bit to realize ||duplicate entries of the same number is allowed with different symbols|| 
That aside, not too bad
I really need to make a commons library though, the number of times I've had to type out an adjacent coordinates list
how can I see what number I finished as? 
leaderboard-personal times
that's cursed is it true?
does it like happen once, so it can't be spotted easily?
...why is this a surprise to anyone lol
ยฏ_(ใ)_/ยฏ
Isn't that just the default interpretation of the problem statement for p2
yeah, not sure what you mean, it seems normal to me that a number can ||be adjacent to multiple gears, contributing to all of them||
For P1
For P1, ||no you don't count the number twice||
Looking back, yeah, definitely. Probably read the problem badly
(also ||P1 doesn't mention gears||)
it's a surprise because i'm looking at my input and i don't see an example
No idea how frequent it is, but didn't work for my actual input, reread the question, took a gamble and ||reset duplicate tracking after each symbol instead of having it cumulative||, and it worked, so no complaints here
that might be true actually, I don't see an example of a ||number with >1 adjacent gear|| in my input either. weird; maybe they throw a bone to people who assume there's a strict 1-2 relationship
I'm glad that happened to me on P1 rather than P2, because I'm sure I would've spent a lot longer debugging
i should create a 2d regex tool 
YES!
would get #1 on these kind of problems fr
this day is kind of a case of "i feel like I should write an utility to make days like this easier, but the problem is weird enough that it doesn't obviously generalize". like, what would I implement, ||neighbour-finding for a set of rectangular cells||?
literally sub 1 minute times and get people to think i'm cheating
80 more lines, another challenge done
finding neighbors is used a bit in aoc tbh
||could a possible edge case be two numbers that are the exact same which are adjacent to a symbol? ||
Accused of AI immediately
or is that not sum to worry about
I haven't seen a situation like that in my input that would effect the result.
Istg 2D regex would be like what people think regex is like lmao
as long as you're not only doing unique values
fr
i remember i thought of the idea when i made boxscript for one of the code jams here
Wait....if we have 1D regex and we can make a 2D regex crossword with it. 2D regex means we can make 3D regex crossword!
but decided to just manually code the 2d syntax
you can make a 3d regex crossword with 1d regex too, I don't see why not
but sure, it'd allow for more cursed stuff
(what's a regex crossword?)
?
wait do i have to || count the number twice if its adjacent to 2 symbols for p1||?
Crossword, but with regex across/down
Yes, at least I needed to for my input
No, at least not for my input
That sounds horrifying. Do you have any examples?
see https://regexcrossword.com/ (although those dumbasses recently reworked their decent UI into some sort of webapp abomination; who thought that's a good idea?..)
^ that
Lmao
If I remember when I wake up tomorrow, I'm gonna modify my solution to find, and tell me whenever that ||number with multiple gears adjacent|| occurs, I really wanna know how frequent it is
never for my input
my test data works but my input data doesnt work ๐ญ
Rip
2nd day in a row that I start without regex, delete everything, use regex.
lol
the dumbest part is that I was ready for it: AoC on left screen, editor in central screen and Regex101 on right screen. Well, it won't happen 3 days in a row.
ig its easier without regex here
until i make 2d regex
he says the gondola lift will take you up to the water source
come back tomorrow for AoC 2022 day 16 2.0: electric boogaloo ๐ฉ
My regex for today || /(?<num>\d+)|(?<symbol>[^\.\d\s]+)/g ||
My regex setup was real dumb for today, but hey, it worked
once i make 2d regex it'll be over
i don't know yet
Not yet
but it'd be a sick project
But if we can, oh the possibilities
This is pretty cool but I hate that I have to drag letters into place rather than just typing like a normal crossword
(and sanity saving)
2d regex would trivialize this lol
Yeah, that's the UI update
Look for any challenges category with a keyboard icon
Those use KB instead of the drag & drop
Never for your input either
so 2 gears are never adjacent to the same number?
(also technically I'm checking something more general than what you said - I'm checking that ||no two symbols share a number|| rather than just checking gears)
I have no idea, and to protect my sanity, I'm not digging further
it's possible to enable keyboard, which I know because it's obligatory for some player puzzles (why isn't it default?..)
Yeah, I meant ||symbol||, not ||gear||
How do I enable the keyboard lol
Who knows
Oh ok once you play one that requires keyboard you can just use keyboard lol
Yeah
Though you can't use arrow keys -_-
The ones with KB are indicated with a KB icon, and iirc the player made ones are KB (or can be made KB by the creator?)
Tab & Enter?
The old UI was much better
KB always, arrow keys worked
my solution didn't work
bc for some reason i didn't calculate the last row
fun challenge
rlly proud of how i did it in kotlin
the hexagonal ones are kinda nifty
advent of regex
how are people using regex for day3 ๐
but yes, regex was involved extensively even in the previous years i believe
i used it ||to quicky grab all numbers in a line along with their spans||
i'd have had to write a lot more logic if not for ||re.finditer||
ahh
huhh i did not think of using regex
||same here, and then i checked the adjacent y and x values by if they were in the span of the numbers||
i went ||numpy||
fancy
i tried ||searching for symbols thru numbers|| first
ok this is a change in perspective
how'd you do it
Numpy has a builtin for finding neighbors?
@signal copper slides into chat: let me tell you about our lord and saviour, scipy.ndimage.convolve
part 2 was either rlly simple or rlly tricky
(i didn't actually use numpy this time, though)
if u ||searched for numbers and then found a symbol and marked it down, it's def harder||
nah, was useful in other ways
this would've been fairly easy ||as a graph problem using networkx|| too i think
would be pretty overkill though
damn yall r crazy smart
i can't imagine doing these problems in ways like some of u do
w google sheets and sql and all
will send solution after a little bit of cleanup
the naive solution is also fine here, the inputs are very small
||iterate through the rows, find numbers, check adjacent cells||
add spoilers please
what was the more efficient way?
I dont understand graphs very well but would u like || pair each star with its neighbouring ints and proceed from there?||
i did that but ||found symbols then looked around for numbers||
||there are fewer symbols than numbers, but maybe parsing the numbers is more difficult if you find the symbols first, e.g. having to look both left and right of a digit instead of only in one direction||
yeah ||what i did was first parse thru and find all the numbers w their span using regex, then iterated again until i found a symbol and looked at all the adjacent cells and see if they're within a span of a number||
||if you look at the indices of where the numbers are, this immediately tells you which cells to check for symbols without needing to iterate again through the input||
that's true
i should've done that
is there some weird interpretation? my friend and I both pass on the test data but not on the main data
aoc chat be like: ||[REDACTED] [REDACTED] Class: Keter [REDACTED] 269[REDACTED] civilians were executed [DATA EXPUNGED]||
at this point i dont even know how to debug, my code gives exactly what i would expect
||i had an issue with numbers on the right edge||
236.236
...*...
yap that would be it
๐
wait no
ah part 2
it couldnt be
f
one fun bug I can see people getting is ||accidentally parsing + before numbers as part of the number, if one carelessly uses a number-parsing utility||
why even need a number parser
i don't know enough built-ins to do this pythonically, so i'll just nest for loops
i bet the aoc libs have them
hi edd
hi
i figure i must be either reading the instructions wrong or there is some weird edge case my brain cant think of
you're gonna have to go through all of the input comparing against your output if you can't see the issue
i did ๐
Could somebody send me the first advent of code? (The link to it)
I mean if ||one uses a number-parsing utility|| they may also ||accidentally parse certain constructs as floats||

Tests pas
Actual does not
Do you mean https://adventofcode.com/2015 or https://adventofcode.com/2023/day/1 ?
then you didn't do it right ๐
agree
make sure you don't count a * as a gear if it has >2 adjacent numbers, I guess.
(or <2)
Thank you very much!
๐
I meant this year XD..
Thank you very much!
what an annoying challenge in day 3
I enjoyed each of the challenges so far, because I made mistakes in each of them.
ahhhh i did it. that was super fun
yeah, it was absurdly annoying for me too
the trick there is ||in a line "oneight", the first digit is "one" and the last digit is "eight" - they can overlap||. the example doesn't really explain this.
looking for someone to help me with my code it works just trying to see if i can make it better or should add anything
Paste it in the spoilers thread for the right day and people will take a look
okie dokie thanks
wait that's a rule?
i didn't do that and i still got past it
The puzzle does specify exactly 2
i don't know if it's actually enforced, but the puzzle statement is fairly unambigous
A gear is any * symbol that is adjacent to exactly two part numbers.
weird
i passed both the test data and my own data
without ever doing that
i j counted a gear as anything with over 1 adjacent number
smh, literally unplayable
huh i counted any over 1, yeah
2023 day 1: horrible edge case not explained in the statement at all
2023 day 3: tons of potential edge cases that carefully never occur in the actual inputs
fr
that's odd lmao
oh I completely missed that too lol
i honestly j never read the prompts correctly
'tons of potential edge cases' no the puzzle's unambiguous this time it's just that you're allowed to make extra assumptions today
atl it didn't set me back today
typical advent of reading comprehension
๐๐
now do day 2
day2 was straightforward, no complaints
it was j fun to implement tbh
day 2 was great
woke up, did day2, went to sleep until midday, no complaints
it's either one of two solutions:
- parsing games into a data structure
- string manipulation
im not lookinb@foreard to the puzzle that has a really easy part 1 and then ur code is too slow for part two
there's always some day like that near the beginning
ik in 2021 it was the jellyfish one
i can't wait







