#advent-of-code

1 messages ยท Page 13 of 1

compact wasp
#

lmao

magic oxide
#

lmao

#

did any of you read that or do I have to send it again

glad wigeon
#

legend

earnest forge
#

Congrats!!! It's way harder to get LB now than it was when I started, so that's really cool!

compact wasp
#

oliver still gapping me though ๐Ÿ˜ฆ

magic oxide
#

Oliver insane

compact wasp
#

he got lb on d1p2

#

and i didn't

#

so

magic oxide
mossy basin
#

i think i spent the longest on the parse

magic scaffold
#

re go boom

magic oxide
#

who even is oliver

rancid creek
#

This should have been the day 1 puzzle. ๐Ÿ™‚

earnest forge
#

^

#

requiring a parsing change for part 2 is nasty and definitely not day 1 material

covert arrow
#

||(\d+) (\w+)|| isn't too bad tbh

earnest forge
#

I mean tbth I just hardcoded in the specific cases

#

That might be useful for the golf though

rancid creek
#

people changed their parse on this one?

earnest forge
#

No for day 1

rancid creek
#

I screwed up by not noticing the 13 changed to a 12 for the input data

earnest forge
#

Ooops lmao

humble copper
compact wasp
#

congrats

magic oxide
#

nice

rancid creek
#

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.

modern terrace
#

at least i didn't do bad in p2 this time

cyan sleet
#

I have managed to read a line

#

progress

unique osprey
#

wow, man i got held up on p1 for no reason

gentle cape
#

I spent abt 10 min on part one bro i need practice

rancid creek
gentle cape
#

Of course, I am attempting everything in Haskell

unique osprey
#

||i was summing all the cubes per game, instead of accounting for each set individually||

compact wasp
#

i'm curious

#

there was like a 3 minute difference between 100 and 300 for day 1 part 2

#

which is a lot

magic oxide
#

day 1 part 2 was an anomaly tho

compact wasp
#

true

magic oxide
#

today's back to normal difficulty

compact wasp
#

thankfully i didn't throw

magic oxide
#

now go golf

stable shale
#

I spent an extra 10 minutes on Part 1, because I ||accidentally only got the first digit of the game ID||...
AAAAAAA

gentle cape
#

Is it fine if I skip a few days? Iโ€™m on vacation for this weekend

#

Like, are they required for the next puzzles?

stable shale
#

No, previous day's aren't required

gentle cape
#

Thanks!

candid berry
#

it's ok to skip problems, it just won't be great for your score ๐Ÿ˜„

zinc kindle
#

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.

gentle cape
compact wasp
gentle cape
#

Rust ๐Ÿ‘Œ

placid lake
#

hmm why was today easier than yesterday

gentle cape
#

Ong though

#

I mean

#

Part one yesterday was easy

zinc kindle
# gentle cape Like, are they required for the next puzzles?

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.

candid berry
#

honestly I'm still mad about yesterday's examples.

compact wasp
gentle cape
compact wasp
#

yeah

gentle cape
#

Dang

candid berry
#

well, yes, but that's not really a puzzle

gentle cape
#

Time to speedrun next week

candid berry
#

that's just a reward for having completed all the other 49 puzzles

compact wasp
magic oxide
#

well day 25 2nd star

modern terrace
#

the 9 minutes delay was horrifying

candid berry
#

9 minutes delay?

modern terrace
#

the time between day 2 starting and me noticing

candid berry
#

oh lol

#

need alarms ๐Ÿ˜„

modern terrace
#

true

compact wasp
placid lake
#

ballmer peak was not necessary, but it's a friday night :D

zinc kindle
#

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.

modern terrace
#

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

compact wasp
#

๐Ÿ˜”

candid berry
#

class 'cereal' (slow)

#

๐Ÿ˜›

earnest forge
#

LOL

modern terrace
#

but that's supposed to be runtime, not coding time ;-;

#

anyway golfing time

naive stone
#

why do i always make the odd decision to write tons of bugs into my code

topaz coyote
#

Some of us have coding as a hobby, and some of us havee debuging as a hobby.

royal gull
naive stone
#

heh

jagged hare
candid berry
#

I made a G&T after finishing it ๐Ÿ™‚

jagged hare
#

nice

naive stone
#

you're not wrong

hallow birch
#

Man that was way easier than day 1 lol

pearl glen
#

while True:
print('I'm brainfucked')

hallow birch
#

I had some fun w/ sets

earnest forge
pearl glen
#

yea brainfuck actually brainfucks you

zinc kindle
#

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).

hallow birch
#

You converted me lol, it's pretty nice

earnest forge
#

๐Ÿ™ƒ

hallow birch
#

I like the separate function for parsing input

earnest forge
#

I mean the best part is clearly the auto tests lol

hallow birch
#

I mean not really, you can just have assert result is <answer> lol, had that before

hollow summit
#

salt die has competition

#

oh wait nvm he wrote both???

earnest forge
#

He co-wrote early versions of aoc_helper, but I've been maintaining it solo for like 2 years lol

earnest forge
hallow birch
#

Yeah tru

#

Btw is there a function for reading the prompt in the terminal?

earnest forge
#

Not currently

hallow birch
#

gh issue time lol

earnest forge
#

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)

cerulean epoch
shut trellisBOT
#
Wrong Channel

You are not allowed to use that command here. Please use the #aoc-bot-commands, #sir-lancebot-playground, #bot-commands channel(s) instead.

cyan sleet
#

part 1 done ๐Ÿฅด

#

god I'm so terrible at functional languages

lusty rover
#

In OCaml?

#

I quit

#

I did the Python, I'll do language learning.... sometime that's not 2am

cyan sleet
#

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...

halcyon pulsar
#

What is the name of the private leaderboard?

somber trench
#

why is part 2 of day 1 ridiculously hard

magic oxide
#

it was an interesting decision for sure

somber trench
#

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

modern terrace
somber trench
#

ill test it tho still

somber trench
#

idk how to fix it tho

modern terrace
#

.finditer() too

somber trench
#

what would u suggest then? cause idk what other thing would help with keeping them in the order they appear?

inner bough
#

I have a solution to puzzle 1 written in brainfuck. Any recommendations on where to post it?

magic oxide
#

the spoiler thread works

#

we don't really care about the language

somber trench
#

day 2 is confusing how it is written

modern terrace
somber trench
#

its hard to understand it

versed plaza
#

how can i connect my discord to aoc
so that i can get that fancy colored name in here?

modern terrace
# somber trench day 2 is confusing how it is written

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 (,)

somber trench
#

this is still super confusing, might be cause im sleep deprived, 4am with no sleep go brrrr

modern terrace
somber trench
#

each game format is different though with each set, idk how i would manage to use that

modern terrace
#

||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

somber trench
#

|| 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? ||

somber trench
#

gonna be a pain

late portal
#

guys i don't understand aoc puzzles, what should i practice bforehand to solve them?

late portal
hollow summit
#

sure? whatever helps you understand the problem statement better

late portal
#

its puzzles are weird tbh

hollow summit
#

you're working for Santa

#

don't complain

late portal
#

hmm no i guess

torn sapphire
late portal
#

whats DSA?

torn sapphire
#

data structures and algorithms

late portal
#

oh

torn sapphire
#

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

late portal
#

i guess i need to practise for 1 year more

torn sapphire
#

there's always previous years' questions to practice on too, especially the ones on the first few days of december

oak pollen
#

For Day 2, Part 1, is it just if total Game's red > 12, total blue > 13, total green > 14 then it's impossible?

late portal
torn sapphire
oak pollen
#

thank you

white laurel
#

not the sum of colors of all game

oak pollen
#

what determines a set?

white laurel
#

by >> ;

torn sapphire
#

the sets are delimited using ;s

oak pollen
#

oh god i didnt even see that

#

thank you so much

torn sapphire
#

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||
oak pollen
#

๐Ÿ‘

hollow wharf
#

funny how in day 2 on part 1 i spent like 30mins but on part 2 it was not even 5mins ๐Ÿ˜ญ

rapid wolf
#

parsing problems do be like that

hollow wharf
#

i should learn regex

#

for that

lost nest
#

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

hollow summit
#

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

hidden musk
#

how fortuitous that i already planned to do ocaml this year and half set it up already

lost nest
#

but ik that this thing works

lost nest
#

i edited 2.1's code

hollow wharf
iron olive
#

Just sat down to try my hand at day two, am not even properly understanding the question

#

Off to a great start

astral iron
#

What is lstrip and r strip

hollow wharf
marsh currentBOT
#

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...
hollow wharf
#

rstrip literally the same but for right side

atomic cairn
#

Does day 2.2 still work with impossible games or is that part not used anymore

magic oxide
#

it's not used

atomic cairn
#

Alright thanks

astral iron
#

NPM leftpad ๐Ÿ˜ญ

magic oxide
#

there's str.rjust, or you could use the f-string format spec

agile orbit
#

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.

rapid wolf
#

Well, what's the last item in a one element list.

covert arrow
agile orbit
#

Aha thanks, I feel stupid now! facepalm

#

Appreicate the sanity check :)

mossy trout
#

Who has done day 2 advent of code?

agile orbit
#

||```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? ๐Ÿ‘€
mossy trout
#

๐Ÿ˜ญ๐Ÿ˜ญ๐Ÿ˜ญ

hollow summit
mossy trout
#

My day 2 is bugging

agile orbit
hollow summit
#

eightwone is expected to return 81

woeful topaz
#

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

modern terrace
#

it works with the general .replace() approach

agile orbit
modern terrace
#

a more not great test case would be 5twone which should return 51

agile orbit
#

Just need to ||replace all instances of words -> numbers, you can use a dictonary for the mappings||

modern terrace
agile orbit
#

Thanks!

#

I'll try my best

modern terrace
#

||5twone should equal 521/5tw1, not 52ne||
||7oneight should equal 718/7on8, not 71ight||

agile orbit
#

Yup, I read the examples given ๐Ÿ™‚

mossy trout
# mossy trout

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

modern terrace
#

that's the problem in your code

mossy trout
#

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?

modern terrace
#

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

mossy trout
#

ok

hollow summit
#

if r>12 or g>13 or b>14 then it's invalid

modern terrace
#
Game 101: 6 red, 7 blue; 5 green, 9 blue, 7 red; 9 green, 2 red
``` this should be a valid game
mossy trout
#

OHHHHHHH

#

i see

#

so each ;

#

is a different iteration ehck

agile orbit
#

Thank you!

magic oxide
#

oi

#

one liners aren't necessarily golfing

upper pike
#

Can I get advent of code for actual morons?

lusty rover
magic oxide
#

well i'm counting one liner as after the file.read().splitlines() in the parser

covert arrow
#

oneline golfing is pretty cool though

magic oxide
#

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

hardy zenith
#

I have two of these and they've been fantastic

sinful pewter
#

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

unique osprey
sinful pewter
scarlet wasp
#

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

unique osprey
#

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

hidden musk
#

by the time you're good enough to get on the leaderboard you've definitely gotten rolled enough times anyway

sinful pewter
#

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

hidden musk
#

strangers around the world that are focused on this event are focused on this event

sinful pewter
#

๐Ÿ™‚

scarlet wasp
#

Don't be afraid to ask for help if you get stuck. All about learning

sinful pewter
#

Got it will do

#

Thank you

agile orbit
#

Appreicate the help

#

I tottaly forgot about regex.... facepalm

compact wasp
#

1 year of getting rolled isn't that much

#

though i'll probably fall off the board once i can't yolo things

magic oxide
#

you say this every time and then still leaderboard PensiveCat

compact wasp
#

i only leaderboarded like 4 times last year

#

and those were not even high leaderboard

magic oxide
#

you weren't there at the start everyday last year

compact wasp
#

true

hollow wharf
woeful topaz
#

about today

hollow wharf
#

ah

woeful topaz
#

but i feel humbled by someone with about 10 lines of code sobbing

hollow wharf
#

i find part 1 harder than part 2 haha

sour trout
#

It seems a little bit confusing to me as never contributed to something

agile orbit
sour trout
sour trout
#

I dont know if i did everything correct to be honest

#

It got added YES

#

All fine thanks

hardy zenith
#

wow today was way easier than yesterday

#

yeesh. I'm way behind on my private leaderboards because of timezones

halcyon pulsar
#

i would be curious what timezones the top people are on

#

whats an ideal timezone?

compact wasp
#

central time to pacific time

#

actually you could probably go west to idl and still have a good timezone

proven quiver
#

Is this a place to ask for help with AoC/

sour trout
#

It was easy

proven quiver
magic oxide
#

||also you're off by one for enumerating nums since enumerate starts at index 0||

ivory dagger
#

For day 2 part 2, you should only calculate for the games you kept after part 1 or for the entire input?

low condor
ivory dagger
low condor
#

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

magic oxide
#

the new type of comprehension

#

we have list comps, set comps, dict comps, gen exprs, and now read comps

compact wasp
#

someone pinging the mods to say the n word ๐Ÿ’€

#

just why

frigid mural
#

Too much time on their hands and not enough brain cells

compact wasp
#

real

#

brick for a brain

magic oxide
#

the n word thing or aoc?

compact wasp
magic oxide
#

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

compact wasp
#

do exec(bytes(ord(c)%i+32for c in'๑ณชช๒›ณด๑ต‘ฆ๒…”ข๓–…ž๑ถŠ‚๑—‹ฏ๒„ฆ'for i in b'efg'))

magic oxide
#

is there no way to get rid of that +32 by using higher ord bytes and different unicode values

wicked elm
#

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 AritaEhehe

terse comet
#

can we not go full esoteric while beginners are watching

magic oxide
#

fair enough

alpine tree
#

hi

untold briar
#

Hello, is 54431 close to the result of challenge 1?

alpine tree
#

how do i sign up for aoc?

untold briar
peak dock
wicked elm
untold briar
#

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

untold briar
#

And there are 950 more to check ๐Ÿ˜‚

alpine tree
untold briar
#

ff6dhvzmdrgt should be 66 right?

untold briar
#

Then read through the puzzles and solve them

low condor
alpine tree
#

woah the puzzles are more of an english challenge than a programming one

compact wasp
#

real

untold briar
# low condor ||yup||

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

alpine tree
#

how do y'all structure your environment for the aoc puzzles?

hollow wharf
compact wasp
#

automated submission as well

#

then shortly before the thing drops i copy a template

alpine tree
low condor
hollow wharf
low condor
alpine tree
hollow wharf
#

im working in the same folder each day

runic isle
alpine tree
hollow wharf
compact wasp
alpine tree
hollow wharf
#

no, its one repo

compact wasp
#

he just uses commit history to see previous code fr

alpine tree
#

so how do i automate getting the input?

hollow wharf
#

!pip aoc-lube

marsh currentBOT
earnest forge
#

!pip aoc-helper

marsh currentBOT
earnest forge
#

:P

rapid wolf
#

I just copy and paste

#

Got notepad open

hollow wharf
earnest forge
#

!pip aocd is a thing too

marsh currentBOT
compact wasp
sour trout
compact wasp
#

your aoc session token

magic oxide
#

you grab it with inspect element

#

salt die's repo has a neat graphic

woven oriole
#

beep bop (session cookie)

hallow birch
sleek remnant
#

is it normal that the page looks like this? I've seen it being an actual christmas tree somewhere

untold briar
#

Hmm, do you guys also think that day2 is easier than day 1?

earnest forge
#

Yes

untold briar
#

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

earnest forge
naive stone
untold briar
#

Yeah if you solve day 2, it will change a bit

earnest forge
#

Tree was 2015 btw

untold briar
#

Oh day 1 was a trebuchet lol

#

I only noticed it just now

#

And day 2 is a floating island I guess?

outer chasm
sharp tapir
#

idk

#

depends

#

managed to do both

#

needed some help figuring out how to parse a string

#

but i had the logic on lock

noble skiff
#

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

cunning scarab
noble skiff
#

Can't tell if you're contradicting me or agreeing with me ๐Ÿ˜›

earnest forge
#

Looks like they're concurring

cunning scarab
#

Not really refering to "any edge cases that caught a lot of people"

glad tartan
#

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>
glad tartan
earnest forge
#

(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

terse comet
#

oh lol

#

eh, if it works it works

earnest forge
#

Damnit Eric

#

(BS4 doesn't understand it lmao)

#

can someone go pester him to fix it

terse comet
#

why are you trying to bs4 it in first place xD

earnest forge
#

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

oak root
#

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

royal gull
marsh currentBOT
#

6. Do not post unapproved advertising.

9. Do not offer or ask for paid work of any kind.

minor ivy
#

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

terse comet
#

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.

minor ivy
#

Ohhhh

#

alright

earnest forge
#

@hallow birch I fixed the console reader to actually render lists now, you should update if you want to use that

livid gull
low condor
sleek cave
#

i finally understood aoc 21 day 22 (reactor reboot)

#

coding it in python tomorrow

#

my redemption after 2 years

low condor
#

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

frigid mural
#

Did a little catchup for Rust but now we're all good

worthy horizon
#

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

zinc kindle
#

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?

terse comet
worthy horizon
terse comet
#

you can probably solve it using a pivot table

zinc kindle
#

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.

somber trench
#

How long will this be open for after the 25th?

hidden musk
#

define "this"

somber trench
#

The advent of code days, the ability to do them?

zinc kindle
#

Until the owner dies and stops being able to pay for the server? You can still access the oldest ones in the archives.

hidden musk
somber trench
#

What year was the first one done?

magic oxide
hidden musk
zinc kindle
magic oxide
#

damn

somber trench
terse comet
#

"only" 8 years

somber trench
zinc kindle
#

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.

somber trench
#

Cool cool

#

Day 2 is a pain idek where to start

woven sable
#

im trying to do aoc in kotlin

#

i was stuck on day 1 part two for a good 30 minutes ๐Ÿ˜ญ

cunning scarab
#

"eightwo"

woven sable
#

oh my god

royal gull
#

Yah. That nearly ended me.

woven sable
#

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

covert arrow
#

I want to do one in piet but there is no way I'm doing day 1 part 2

cunning scarab
#

But I'm glad everyone else struggled as well I nearly had a stroke.

woven sable
cunning scarab
woven sable
#

i'm pretty sure that day took me 6 hours

#

yeah i think so

#

the one w the different 3D scanners

minor cave
#

tempted to otn oneightwo

hidden musk
#

twone

cunning scarab
lapis pilot
#

This is my first yearโ€ฆ how much harder does this get???

cunning scarab
lusty rover
woven sable
#

the first day is usually not this hard honestly

cunning scarab
#

I really like the rocket fuel one

minor cave
#

!otn a oneightwo

marsh currentBOT
#

:ok_hand: Added oneightwo to the names list.

lusty rover
lusty rover
woven sable
#

i think it peaks around day 18-20?

#

usually they don't make it as hard on day 25 bcs it's christmas

hexed axle
#

I should give part two of day 1 a shot, it looks like everyone had โ„ข๏ธ*f*u*n*โ„ข๏ธ with it

woven sable
#

idk how long i'll be able to do this in kotlin

#

before i switch back to python

royal gull
lusty rover
woven sable
#

i can code most things in it

hexed axle
woven sable
#

like i can code everything if i search some things up

#

i'd say im pretty comfortable with it

lusty rover
#

I actually accidentally completely skipped all of the edge cases with my original implementation

woven sable
#

im gonna attempt day 2 rn

lusty rover
#

Good luck!

woven sable
#

i would've been so happy to do day 2 in python

#

looks like u could use ||match/case|| so the it

#

with*

lusty rover
woven sable
#

true

lusty rover
#

Let me know you wanna see

woven sable
#

wait can u send ur solution im curious how u did it in python

#

yeah fs

lapis pilot
#

What are you using @woven sable?

molten fulcrum
#

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?

woven sable
woven sable
#

what does math.prod do?

#

i might try day 2 using ||classes||

molten fulcrum
covert arrow
#

I don't think there were any other edge cases

lusty rover
molten fulcrum
cunning scarab
lusty rover
lusty rover
#

!docs math.prod

marsh currentBOT
#

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.
covert arrow
woven sable
#

also ||eightwothree should be 8wo3 or 823 however u did it|| but i'm sure u alr know that

molten fulcrum
cunning scarab
cunning scarab
covert arrow
#

It's pretty niche so adding it as a builtin would just be bloat

somber trench
#

I've given up on this year so imma start at 2015 and move up lol

cunning scarab
lusty rover
cunning scarab
#

Guessing d1p2 lell

#

If you've done d1p1 then you can do d2p1&2

covert arrow
cunning scarab
somber trench
lusty rover
somber trench
#

Day 2 part 1, Day 3 ain't out yet so

lapis pilot
lusty rover
lusty rover
somber trench
tepid cairn
#

I wanted to do this year in Agda but Agda doesnโ€™t have any decent IDE tooling ๐Ÿ˜ฉ

lapis pilot
#

Oh.. I meant my daily language that Iโ€™m hearing of for the first time

#

๐Ÿซ 

lusty rover
cunning scarab
#

My daily language is dutch.

#

I don't recommend it

lusty rover
lusty rover
#

At work Iโ€™m rebuilding a Spring app and Iโ€™m rewriting the Java to Kotlin

#

Itโ€™s been nice

lusty rover
# somber trench Getting what?

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

somber trench
lapis pilot
#

Waitโ€ฆ are we not supposed to research methods on Google?

somber trench
lapis pilot
#

Phew ๐Ÿ˜ฎโ€๐Ÿ’จ

magic oxide
#

you can google as much as you want

cunning scarab
molten fulcrum
#

Time for some OCaml

sleek cave
#

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

woven sable
#

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

woven sable
#

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

lusty rover
lapis pilot
#

Iโ€™m curious to look at the other languages

jovial jay
#

i'm challenging myself to use a non-generic language to do the AoC

tepid cairn
tepid cairn
hexed axle
#

AoC in PowerPoint?

lusty rover
tepid cairn
#

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

woven sable
#

where's the roulette

jovial jay
# hexed axle AoC in PowerPoint?

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.

woven sable
hexed axle
tepid cairn
jovial jay
lusty rover
hexed axle
cunning scarab
tepid cairn
woven sable
#

is advent of code at 12 am est

#

im jealous of ppl on the west coast

lapis pilot
#

I think itโ€™s funny that Ocaml describes itself as โ€œindustrial-strengthโ€

hidden musk
#

it's used by like 2 companies at least

lusty rover
lusty rover
hidden musk
#

semgrep, jane street

lusty rover
#

Anyone important?

hidden musk
#

me

lost nest
#

guise

#

did anyone unlocked problem 3?

peak dock
#

&aoc c

shut trellisBOT
#

Day 3 starts <t:1701579600:R>.

leaden tartan
#

Got in right under the wire!!

celest rain
#

i learn a new language every time i do aoc, shit's crazy

compact wasp
magic oxide
#

looks like I can't make it today either PensiveCat

visual nebula
harsh heart
#

oh shit

#

advent of code started

leaden tartan
#

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

compact wasp
#

just sleep

earnest forge
#

Nearly missed waking up for today lmao, luckily I'm up now

minor cave
#

Language Roulette: Day 3
The language is ... Haskell

placid lake
#

some people are going to have a field day today

lusty rover
#

oh no

peak dock
#

my time has come

compact wasp
#

๐Ÿ˜ˆ

lusty rover
#

I tried Haskell last year

#

I couldn't read the file

compact wasp
#

haskell is fun

sharp panther
#

deciding whether to do this problem now is going to depend on how hard the parsing is :(

compact wasp
peak dock
sharp panther
#

10 seconds...

lusty rover
shut trellisBOT
sharp panther
#

...yep we have some parsing work, this is a tomorrow me thing

valid brook
#

ayy

minor ivy
#

Day 2 is hard as fuck

#

I can't do it

potent pumice
#

i'm a bit surprised language roulette isn't automated lol

lime steeple
#

yikes

lusty rover
#

sheeeet

#

I don't even know how to do this in Python

sleek cave
#

tf is with aoc and parsing this year

white laurel
#

ok this one is need time XD

lusty rover
#

The lack of a thread going up is making me worried about part 2

lime steeple
#

we all read the problem and decided to go to bed

sharp panther
#

the lb is full :)

#

took surprisingly long

hexed axle
#

11.5 minutes, on day 3

lusty rover
#

SUPRISINGLY?!

#

Have you SEEN the problem

#

I'm stuttering over here

sharp panther
#

surprisingly, as in for a rather early day

#

the problem is not easy, yes

compact wasp
#

fuck i was scrolling reddit and didn't see the time

#

i should've seen the timestamp on my discord message

fleet fox
#

day 3 is... not ok

compact wasp
#

doesn't seem that hard tbh

fleet fox
#

its making my brain rot

compact wasp
#

though i get the feeling that these are intentionally designed to be difficult for gpt to do

covert arrow
#

i was watching owc ๐Ÿ˜”

earnest forge
#

I'm dumb

white laurel
#

can't figure it out

earnest forge
#

I spent like 10 minutes on what turned out to be a name shadowing error

woven solar
#

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?

earnest forge
#

Lmao

hazy ermine
hollow wharf
#

I'm going to bed ๐Ÿ’€ ๐Ÿ˜ญ

#

This is a problem for future me

iron olive
#

I dozed off; how is day three? hard?

hazy ermine
#

a little, yes

iron olive
#

Harder than day two?

#

I mean, that's to be expected

#

But how much?

hazy ermine
#

yea its more annoying to process the input than hard

iron olive
#

Depending, I'll go straight to bed and leave that for tomorrow me

#

Well, that's for tomorrow me to solve

#

Nighty night

woven solar
#

about the same as day2, IMO, and way easier than day1 ๐Ÿฅด

candid berry
hazy ermine
#

why did they mess up the difficulty lol

iron olive
#

I'm tempted to peek at it

candid berry
#

day 1 just needed better examples

iron olive
#

But if I do, I'm solving it

candid berry
#

it really wouldn't have been bad if the examples had properly covered the edge cases

hazy ermine
woven solar
#

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)

candid berry
#

it points out what the problematic case is, but it doesn't tell you how to handle it

woven solar
#

yeah, that's true

candid berry
#

there isn't an example where ||the rightmost digit is part of an overlap||

earnest forge
#

(in fact, it's never used at all)

candid berry
#

I dunno. I didn't find 1 hard, just underspecified

#

and that's frustrating

earnest forge
#

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

hazy ermine
#

well tbf the ||parsing is the logic here||

earnest forge
#

Ig

compact wasp
#

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

deep ferry
#

bruh i had a dumb bug for problem 1 today

#

because

#

||file.readlines() includes the \n after every line||

feral hazel
#

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

deep ferry
#

so like file.readlines() != file.read().splitlines()

#

i'm never using file.readlines() ever again

deep ferry
#

and a for loop for it

#

imo it's cleaner

livid gull
#

time to go back to sleep

feral hazel
#

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

woven solar
stable shale
#

Took me a bit to realize ||duplicate entries of the same number is allowed with different symbols|| facepalm
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

brazen bridge
#

how can I see what number I finished as? think

woven solar
#

leaderboard-personal times

velvet stag
#

does it like happen once, so it can't be spotted easily?

earnest forge
#

...why is this a surprise to anyone lol

stable shale
#

ยฏ_(ใƒ„)_/ยฏ

earnest forge
#

Isn't that just the default interpretation of the problem statement for p2

woven solar
#

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||

stable shale
#

For P1

earnest forge
#

For P1, ||no you don't count the number twice||

stable shale
earnest forge
#

(also ||P1 doesn't mention gears||)

velvet stag
#

it's a surprise because i'm looking at my input and i don't see an example

stable shale
#

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

woven solar
#

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

stable shale
#

I'm glad that happened to me on P1 rather than P2, because I'm sure I would've spent a lot longer debugging

compact wasp
#

i should create a 2d regex tool kek

compact wasp
#

would get #1 on these kind of problems fr

woven solar
#

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||?

compact wasp
#

literally sub 1 minute times and get people to think i'm cheating

odd wigeon
#

80 more lines, another challenge done

compact wasp
woven sable
#

||could a possible edge case be two numbers that are the exact same which are adjacent to a symbol? ||

stable shale
compact wasp
#

fr

#

but it's just me using 2d regex

woven sable
odd wigeon
woven sable
#

like ||35*35||

#

alr awesome

#

cuz idw recode anything

earnest forge
odd wigeon
#

as long as you're not only doing unique values

compact wasp
#

i remember i thought of the idea when i made boxscript for one of the code jams here

stable shale
#

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!

compact wasp
#

but decided to just manually code the 2d syntax

lost nest
#

i have a question here

#

are numbers counted as symbols?

woven solar
#

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

earnest forge
#

(what's a regex crossword?)

lost nest
empty eagle
#

wait do i have to || count the number twice if its adjacent to 2 symbols for p1||?

stable shale
#

Crossword, but with regex across/down

stable shale
empty eagle
#

smh

#

ok

earnest forge
earnest forge
woven solar
stable shale
#

^ that

earnest forge
#

Lmao

stable shale
#

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

woven solar
#

never for my input

earnest forge
#

Never for my input

#

If you wanna send me your input I can find out for yours

woven sable
#

my test data works but my input data doesnt work ๐Ÿ˜ญ

earnest forge
#

Rip

humble escarp
#

2nd day in a row that I start without regex, delete everything, use regex.

hazy ermine
#

lol

humble escarp
#

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.

hazy ermine
#

ig its easier without regex here

compact wasp
woven solar
#

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 ๐Ÿ˜ฉ

humble escarp
#

My regex for today || /(?<num>\d+)|(?<symbol>[^\.\d\s]+)/g ||

stable shale
#

My regex setup was real dumb for today, but hey, it worked

compact wasp
#

once i make 2d regex it'll be over

hazy ermine
#

2D regex wtf

#

u can do that?

compact wasp
#

i don't know yet

stable shale
#

Not yet

compact wasp
#

but it'd be a sick project

stable shale
#

But if we can, oh the possibilities

earnest forge
stable shale
#

(and sanity saving)

compact wasp
#

2d regex would trivialize this lol

stable shale
#

Look for any challenges category with a keyboard icon

#

Those use KB instead of the drag & drop

earnest forge
stable shale
#

HMMMM

#

ยฏ_(ใƒ„)_/ยฏ

hazy ermine
earnest forge
#

(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)

stable shale
#

I have no idea, and to protect my sanity, I'm not digging further

woven solar
stable shale
earnest forge
stable shale
#

Who knows

earnest forge
#

Oh ok once you play one that requires keyboard you can just use keyboard lol

stable shale
#

Yeah

earnest forge
#

Though you can't use arrow keys -_-

stable shale
#

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?)

stable shale
#

The old UI was much better

#

KB always, arrow keys worked

earnest forge
#

Ugh

#

(no, enter does nothing)

stable shale
#

Yeah, I dunno then, gone?

woven sable
#

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

compact wasp
vestal breach
#

advent of regex

hazy ermine
#

how are people using regex for day3 ๐Ÿ’€

#

but yes, regex was involved extensively even in the previous years i believe

naive stone
#

regex was very handy for today. Just solved part 1 finally

#

part 2 seems tricky

woven solar
naive stone
#

i'd have had to write a lot more logic if not for ||re.finditer||

hazy ermine
#

ahh

placid lake
#

huhh i did not think of using regex

woven sable
placid lake
#

i went ||numpy||

woven sable
#

regex saved me fs i was lost asf

#

for a good 30 min

naive stone
woven sable
#

i tried ||searching for symbols thru numbers|| first

hazy ermine
woven sable
young tree
woven solar
woven sable
woven solar
#

(i didn't actually use numpy this time, though)

woven sable
#

if u ||searched for numbers and then found a symbol and marked it down, it's def harder||

placid lake
#

this would've been fairly easy ||as a graph problem using networkx|| too i think

#

would be pretty overkill though

woven sable
#

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

placid lake
#

will send solution after a little bit of cleanup

signal copper
#

the naive solution is also fine here, the inputs are very small

#

||iterate through the rows, find numbers, check adjacent cells||

hazy ermine
#

add spoilers please

woven sable
#

what was the more efficient way?

young tree
woven sable
#

i did that but ||found symbols then looked around for numbers||

signal copper
woven sable
signal copper
woven sable
#

i should've done that

pine ravine
#

is there some weird interpretation? my friend and I both pass on the test data but not on the main data

woven solar
#

aoc chat be like: ||[REDACTED] [REDACTED] Class: Keter [REDACTED] 269[REDACTED] civilians were executed [DATA EXPUNGED]||

pine ravine
#

at this point i dont even know how to debug, my code gives exactly what i would expect

placid lake
vestal breach
#

236.236
...*...

pine ravine
vestal breach
#

๐Ÿ‘

pine ravine
#

wait no

placid lake
#

ah part 2

pine ravine
#

it couldnt be

vestal breach
#

f

pine ravine
#

mine does work on edges

#

bottom screen shot is numbers my system caught

woven solar
#

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||

pine ravine
#

why even need a number parser

signal copper
#

i don't know enough built-ins to do this pythonically, so i'll just nest for loops

placid lake
#

i bet the aoc libs have them

pine ravine
#

hi edd

signal copper
#

hi

pine ravine
#

i figure i must be either reading the instructions wrong or there is some weird edge case my brain cant think of

signal copper
#

you're gonna have to go through all of the input comparing against your output if you can't see the issue

pine ravine
#

i did ๐Ÿ’€

harsh obsidian
#

Could somebody send me the first advent of code? (The link to it)

earnest forge
lusty rover
#

firHmm
Tests pas
Actual does not

signal copper
pine ravine
#

agree

woven solar
#

make sure you don't count a * as a gear if it has >2 adjacent numbers, I guess.

earnest forge
#

(or <2)

harsh obsidian
harsh obsidian
vestal kelp
#

what an annoying challenge in day 3

royal gull
#

I enjoyed each of the challenges so far, because I made mistakes in each of them.

muted aurora
#

Today's one was kinda pain

#

All kinds of pain

naive stone
#

ahhhh i did it. that was super fun

pine ravine
#

it was them gosh dang new line characters messing me up

regal pumice
#

lol I can't get past day 1 part 2

#

wtf

woven solar
#

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.

strange magnet
#

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

lusty rover
#

Paste it in the spoilers thread for the right day and people will take a look

strange magnet
#

okie dokie thanks

woven sable
#

i didn't do that and i still got past it

earnest forge
woven solar
# woven sable wait that's a rule?

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.

woven sable
#

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

woven solar
#

smh, literally unplayable

placid lake
#

huh i counted any over 1, yeah

woven solar
placid lake
#

fr

woven sable
#

that's odd lmao

covert arrow
woven sable
#

i honestly j never read the prompts correctly

earnest forge
#

'tons of potential edge cases' no the puzzle's unambiguous this time it's just that you're allowed to make extra assumptions today

woven sable
#

atl it didn't set me back today

covert arrow
woven sable
#

๐Ÿ’€๐Ÿ’€

woven sable
#

i loved day 2

#

fav day so far

woven solar
#

day2 was straightforward, no complaints

woven sable
#

it was j fun to implement tbh

placid lake
#

day 2 was great

woven solar
#

woke up, did day2, went to sleep until midday, no complaints

hollow summit
#

it's either one of two solutions:

  1. parsing games into a data structure
  2. string manipulation
woven sable
#

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

naive stone
#

i can't wait