#advent-of-code
1 messages Β· Page 42 of 1
same
i just searhced stackoverflow
lmao
i'm going for a vanilla solution, i feel like i'll lose my sanity at some point
wish me luck
Then you're good
Hey, can I keep days of aoc as pending or do I have to activiely do it everyday? ie can I do a week's worth of aoc question next Sunday and have 14 stars?
yep
You can ever do past problems from all the way back in 2015, no time limit
Hold up, so I can (potentially) have 300 stars added to my profile by solving old (previous year) questions?
The star totals are different for each year, but yep.
Example
every year is 50 stars
(though I don't know where that stars/year page is that @signal grotto showed)
The events link on the top
There's a separate leaderboard for each year
Ah correct, lance only fetched the current year
yea
But yeah basically each year is a totally separate event with different leaderboards, stats, everything, but you can still access all the previous events
by the end of this year you can get up to 350 stars
the real challenge is to be consistent for the 25 days smh
my plan is so solve every problem in the last few days kek.
you are surprised you got the right answer?
idk what changed between the first attempt and the second but i got it to work
extremely
(no quotation marks needed, we can now handle spaces in names)
heyyy that was me, I did that part π π
.aoc link OSEP
You have linked your Discord ID to OSEP.
woohoo part one completion
yay!
wait I commented on it and ensured that was true for the link command π
.aoc link eiyashou
You have linked your Discord ID to eiyashou.
On the leaderboard on the aoc website, it's showing my rank different as compared to the leaderboard provided by the bot
The leaderboard we show on discord is actually 7 leaderboards combined
Due to the size of our community we need multiple leaderboards. So we query all of them, re-rank, re-score, and then produce the output here
Oh, ok!
@minor cave is there not an unlink command?
.aoc unlink
The traditional command to invoke unlink is rm
Any guesses at what the picture is going to be? π
seabed
Christmas Atlantis π
submerged Statue of Liberty...
submarine cruising along the seabed and encountering all sorts of stuff lol
Submarine
"stuff" being a seemingly random collection of multicoloured punctuation
where all the misused apostrophe's go
Sorry i have ocd but i am wuite well in programming can anyone help me with these challenges
Do you have any specific question? If you need a bunch of help, using the spoiler channel may be more appropriate
I need someone to talk to
maybe a help channel is better then
What code editors do you guys use for AOC?
visual studio mostly, sometimes vscode or emacs
pycharm is also popular with some people.
I was thinking about learning vim
vscode
because i just use Python Idle and if i used something better i couldve probably gotten something better than 77th on day 1
its just easier for me
nvim
i use vscode
specifically,
nvim because i try too hard
all the semicolons
where do they all come from?
all the semicolons
where do they all belong?
i should mention that i use a bunch of bash scripts alongside nvim for like. a lot of things
same lol
i have one for download one for running with sample input and one for running with real input
also i love this lol
looks like a squid/octupus tentacle
cloc is an alias for ssc, another code line counter
i think it is probably a seafloor
day 1 is for sure top of the sea, the blue . look like air bubbles
this reminds me i need to make my run bash script better
currently it runs the program twice
ascii art π
I'm going to gues that it'll be about going really far under ground, and that it's a coat which is descending. when we get low enough underground we'll come back out the other side of the earth lmao
like a journey to centre of the earth thing
and the nwe fight a dinosaur
pretty sure it's an ocean picture.
we had sea monsters last year, does that count?
huh entire day and I still dont understand how code that works on example input doesnt on real one
I guess Ill give up
lmfao

i see what you did there
yeah
day 4 is interesting π©
I hate day 4
Iβm still really unhappy with how ugly my code is
i love day 4
I love every single day
:x: @rustic cobalt, please (temporarily) enable DMs to receive the join code
Yes
Yes
What's stopping people from linking their discord ID to a name on the leaderboard that isn't their own?
when I linked mine it didn't check anything so I assume I could have gone through and picked the first guy on leaderboard not to have linked already and pretend thats me
So, how hard do these problems get? I'm a tad concerned because day 4 took me over an hour, so if it gets several times harder than that at the end, I might not have the time or ability to finish?
As an example
i dont even understand how you would do that
2020 day 25 wasn't that bad tbh
Hmm that honestly doesn't look that hard
Mostly trusting that people who are invested in Advent of Code wouldn't really want to do this. There isn't a good way to verify that the person linking is the holder of the same account, so some of it is trust. I will be doing some verification before we assign the roles and we have ways to forcibly unlink in the odd scenario.
Fair enough, thanks for the reply :)
oh yes. "it is me, LX.. where is my role"
how do we link our discord ID?
I only managed to link my account to github
mmm i still havenβt gotten around to todayβs yet
I was referring to the in-server thing
See #announcements
okay ty
haha, I will most likely manually verify the top 100 since most are somewhat known to me and a fair bunch are staff
Like, it's going to be obvious if someone besides Oliver tries to link to their leaderboard name
Just ordered my advent of code shirt, first piece of programming merch I bought
I wonder if you can do some of them automatically
if an account has GitHub linked to both AoC and Discord
We were looking into it, but bots don't have access to the Github linked information in profiles
oh, unfortunate
So we have some other solutions vaaaguely in the works, but we didn't want to block this in the meantime
We'll always have some ability to manually link in the case of the anonymous users
what?
2020 25 was relatively easy
you shouldve shown 2020 20
I gave up on day 10
hell, day 25s are quite easy compared to the previous days
Hey, how are you guys checking how many bytes your code has?
every ascii character is one byte
so unless you are using various unicode chars, it's just the char count
is space also an ascii character?
yup
thanks
Throw it into code.golf if u wanna be quick about it
https://en.wikipedia.org/wiki/ASCII#Printable_characters
Basically every letter of the latin alphabet, and all the "normal" special symbols
pick a random problem and paste ur code in just to use their byte counter
>>> len('ΠΏΡΠΈΠ²Π΅Ρ'.encode("utf-8"))
12
cyryllic is 2 bytes per char in UTF-8, for comparison
hey
o/
π
i still am on day3 part2 i just dont have much time to do much of anything ;-;
it took me quite long to find the solution for day3 part2. but it was worth it ;)
Is it possible to link google, reddit and github to the same account?
I just signed up using my github and I wonder if I can link my google and reddit as well
Reddit and GitHub, yes. IDK about Google
#advent-of-code-spoilers-archive, please, and delete the one here
How?
soryr
no worries
Once I signed up using my github, I can't seem to find an option to also link my reddit
Or any other service they allow (I'm positive that I saw google too, not sure if there were more)
I have the opposite problem - I signed up with Reddit but wished I used Github or Google instead
can someone help me debug day 3 part 2
https://twitter.com/ericwastl/status/1467243576966983685?s=20 just putting this tweet out here from the creator of aoc
If you're doing #AdventOfCode and learning stuff, but your code's a mess, you got the wrong answer, you're a few days behind, it took you several hours, you're in a language you're not familiar with...
All I hear is that you're learning stuff. You're doing great!! πβ€οΈππ§βπ
102
591
what a great guy
he really is
also if you haven't watched his BTS video for AoC, I highly recommend it
Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other. In this talk, the creator of Advent of ...
what was the hardest aoc puzzle?
i've only really done 2020, so probably the sea monster one
i don't know which day is that lmao
surprisingly, the hard question is easy to understand
Sea monster IMO wasn't that hard but it was long
yeah, i would have no idea how to approach this other than brute-forcing
I felt like I would never stop writing code that day
aoc questions in a nutshell:
blah blah blah blah blah
what is blah multiplied by blah?
they like multiplication so much lmao
good way to require finding multiple numbers and still submit one solution
those are our Python help channels π
How do I play?
check out #911684406605930496!
I don't think I'll make it
I was struggling on D4 today
This is when I start writing maintainable code
The reason I struggled is because I didn't know what my code did after a bit
it's all about the speed. the faster you do it, the less it matters when you forget what your local variables do
i might just give up
I understand that feeling - what helps is taking a break or clear your mind with something so you come back with a better mindset
and you might be able to solve your puzzles
lolol true, I wrote at least 10 ugly nested for loops yand I just gave up trying to figure out what did what
i have an idea
i know, but i don't see any addition lmao
I feel called out
doesn't work for day 4
Huh really? It worked for me
would need to choose the bold part of pre.code
Thanks for the link, seems like a good talk
I'm on phone right now one second
resp = requests.get(url=self.url, cookies={"session": self.session})
soup = BeautifulSoup(resp.text, "lxml")
test_input = soup.pre.text.strip()
current_part = soup.find_all("article")[-1]
last_sentence = current_part.find_all("p")[-2]
answer = last_sentence.find_all("code")[-1]
if not answer.em:
answer = last_sentence.find_all("em")[-1]
answer = answer.text.strip().split()[-1]
try:
answer = literal_eval(answer)
except ValueError:
pass
return test_input, answer
cool thanks :D
Np!
I'm gonna stop using my helper besides testing though
because it sends too many requests
too many? why? would probably be only 2 on two different endpoitns
are you not caching them 
I am not
well
oh no, do it
It's because I always make a eequest when I run my code because I haven't included a flag to not submit a request
I honestly don't like my submit helper function though
I just like the testing feature of my helper
coments π
@hidden musk your about me is simply cruel.
idk what you're talking about
the game
?
same 
or are you inferring about something else
after some time i gave up trying to do it in the ipy kernel and switched to jupyter
Time to go try hard mode and get that AoC completionist role!
3 hours.
advent of code is hands down the coolest programming event i've ever attended lol
what on Earth am I looking at
Gets sample input and answer
Works for every day I've tested so far
perhaps I should make my own
but I'm busy being stuck on day 4
not even busy, I've practically given up
You can do it, I think it's just getting the bingo boards to be ready that was most confusing for me
I... cannot stand things involving "boards"
it doesn't work for most days < 2021 since the format is different, some days don't have inputs
wdym?
day 4 goes pretty quickly once you have the data read in correctly.
idk how to explain it, but I hate the sort of game-y board things
Right?
It's cause of the nested lists right?
it only works if you haven't attempted the problem before
lists seemed fastest, numpy was a little slower, and pandas was a LOT slower.
me who doesn't know numpy, and goes the lists way :(
lucky!
yeah
not lucky, sometimes lists can get tiring
Nested lists are a whole lot of "what the hell am I looking at?"
\β οΈ ignore
it wasn't even a 2D list, actually
my type annotation for my boards variable ended up being seq[seq[seq[int]]]
numpy would be so annoying to typehint
you can't even do that without a separate package
and I think it doesn't allow nice typehints of sizes
no spoilers here, but I had a lot of indentation in my first version:
with
for
for
if
for
for
if
if
if
print()
im not sure what's wrong with my code, but it works for the example, but not the actual problem : (
with a few more for loops in the middle of comprehensions in there. π
head over to spoilers and I can tell you what you did wrong.
what on Earth is this ungodly code
is this day 4? if it's day 4... this is exactly why I refuse to do it
i too find them hard to wrap your head around, especially when shit gets deep by adding more loops on the 2d-nested-loop. take today, for example, you have to loop through every number, and for every number, loop through every matrix, and for every matrix, loop through every array, and for every array, loop through every item
it's insanity
I hear some Nim programmers use a specific module called "arraymancer"
but... I truthfully have no idea what it does
same lmao
well tried something out
could you guys test it
works on 2021 puzzles only
one bug
i need to reload the imports
Can you do a day before you do a previous day?
yeah
ty
oh shit, i forgot, I am passing the functions and not importing them
how do i reload it now?

are you going to attempt day 4?
it's really fun
Probably
but I've been busy the last couple days, and I want to do today's if I'm awake
fun
yes, definitely
it will probably get slightly easier on monday, but continue to get harder over the week
Hi, how to get the AOC role?
Try running !subscribe in #aoc-bot-commands and click the Advent of Code option
i hope this time's problem is easier than yesterday's
I went to a wedding today and had several many drinks. Today's will be a challenge...
βΉοΈ
π
lmao
damn
they prolly are behind syllabus completion smh
yes, fun
ngl I despise nested lists so much
whenever I see "make a game board" I cry inside
because I know I'll need to use nested lists
getting hype for day 5
I'M HYPE
Hopefully a nicer data structure than yesterday
trees or graphs or something pls
Binary trees are so easy what
i mean i never worked with them yet
i dont think they'll literally go into core concepts , if they even went , they'll explain what it is
π
it's like a tree but simpler :D
.aoc c
Day 5 starts <t:1638680400:R>.
who's excited??
GLHF everyone
I'm ready for some submarine action
wonder what craziness the sub will encounter today
Okay! You have been unsubscribed from notifications about new Advent of Code tasks.
π
.aoc c
Gotta get your veggies :P
Day 5 starts <t:1638680400:R>.
leek as in the vegetable? π€£
I wonder if it's a Despair Squid
.aoc unsubscribe
Okay! You have been unsubscribed from notifications about new Advent of Code tasks.
lol auto typo cheeker
"The squid didn't like that you beat it at bingo. It is plotting its revenge, but you intercepted its brain waves and need to stop it before it destroys you and the submarine."
the squid needs your credit card information
gl
hf
.aoc c
Day 5 starts <t:1638680400:R>.

10 secs
<@&518565788744024082> Good morning! Day 5 is ready to be attempted. View it online now at https://adventofcode.com/2021/day/5. Good luck!
"Oops! The squid had a tin foil hat on, which miraculously stayed on underwater. Now, you must encode the data so it isn't scrambled as it passes through the hat. The hat uses XXX encryption."
it's on
oh. that's what I forgot to do
field of hydrothermal vents on the ocean floor!
Aw this one isn't as hard as I thought it'd be, wish I was at home for this
AW HELL NAH
Coding on phone is unpleasant
LINES
AAAAAAAAA
my brain can't comprehend
interesting
idk geometry math
this is too much
I just woke up as well
1st one doesn't need math actually
that is the only thing you have to check
I'm gonna talk after finishing
tuple time
er... frankly I dunno if it's possible to explain that line more simply
._.
I got 10 points today :)
Oof
The gride should be of 9X9?
file load is screwing my mind
No, my input went up to 989
My guess is that it's around 1k
yeah
hhhhhhhhhh
Yeah no this problem is nice to us :)
imagine if it showed a desmos graph
π
||breshenham||
you definitely don't need that algorithm
||y=mx+b||
Also no
going slow again today to make pretty code
this puzzle is funny
I'm just curious about how fast do you have to solve aoc problems to be in the first 100
usually a couple minutes
Someone willing to give me their input and output?
sure, one sec
||top 2 lines have answers https://paste.pythondiscord.com/qafaqefiqi.apache|| (spoilers maybe?)
test cases are unique?
nah we all have different input/output
yeah, or at least there are pools of testcases and we probably have different ones
oh
If you have the same inputs do tell 
man, i really don't see how my code could be wrong
I would assume that outside of a few specific examples (day 25 2019 comes to mind) most inputs are randomly generated to template
for p1 of your input, i get ||4929||
i can't imagine i'm missing some edge case, it's a straight forward problem
those answers were accepted 
i'm off by 3
fisk, ||are you filtering out lines that are not straight?||
I agree with discrete lmao
|| 5832 ||
Weird
yea, i ignore ||diagonal lines||
Are you ||forgetting to include the ends of the lines|| or something?
nah, i'm getting the right answer (5 points) for the test input
Don't judge the repetitiveness copilot did all that grunt work lol
i love these insane moments where my code seems flawless and yet i get the wrong answer
if you want help debugging #advent-of-code-spoilers-archive exists for that ig
I meant fisk but yeah I see your point
Ok I don't care about the leaderboard anymore
I'm not done yet
Day6 is gonna be ||find the shortest path through the field of vents|| I'm calling it π
sus
@hollow wharf How many 1's did you get?
for p1 or p2?
p1
||95878 exact 1's||
morning people π
See this @void ocean
if two lines form an L shape do they overlap?
the ranges are end inclusive
yes i did
I have a numpy question: is there any effective way to modify all the elements between two points that isn't a bunch of if and for statements? I solved part 1 but I kinda wanna see if I can clean it up a bit for part 2
not including diagonals?
i mean, ideally including diagonals but i'd be fine without it
I know how i can do it with a bunch of if and for loops but i feel like there's gotta be an easier way to do it
.aoc leaderboard JustAnAverageGuy
:x: Please use #aoc-bot-commands for aoc commands instead.
me too
:D
but after seeing part 2
π
my runtime is fucked
lemme fix
took my pc 3 min to get the answer to part 1 lol, but it worked
Hello, I don't understand what I need to do in my challenge. Should I ask here or somewhere else?
same
check if you used x instead of y somewhere 
lmao same
b r u h .
π
it worked
thanks
lol
I made this mistake and was so mad 
do you put all the x1s x2s and y1s and y2s into theyre own lists? im not quiet understanding how to tackle this problem
thats why the runtime is fucked
i prolly need a clever wayy which does not include numpy
lmao
hint: ||you do not need any matrix for this problem||
there is a subreddit too.. you can get the link in the website
idk if that spoiler really spoils anything tbh
Same my runtime is fucked
what approach did u use
mine came near instantly
it took 4-5 seconds only for the 2nd challenge
(tell in #advent-of-code-spoilers-archive )
:incoming_envelope: :ok_hand: applied mute to @stable heron until <t:1638687022:f> (9 minutes and 59 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).
Can I? ^
You'd want to ask in #advent-of-code-spoilers-archive
ohh
are you asking what the challenge is?
wait I think that goes there, not sure
No, I don't understand what I need to do in the part 2 π
Same, but with diagonals π
guys i did it!!
I started a day and 2 hours late
lol
hey I am having a problem with a lot of stuff, the input is weird
it shows 491 as that
idk why it is tho
help me
how are you reading your input
using a file
um...
when I do int(line.split()) and stuff
it gives me a value error
oh now it works
well I am not doing that, I am converting specific strings to int and storing them on a tuple
This looks like something you'd see in an editor and you're using the wrong encoding
what I did was create the file again
and it worked
the only difference is i created it using manuvally
instead of using echo
maybe that's something idk
I meant a list but
In [3]: type("".split())
Out[3]: list
You can't really convert sequences to ints other than string
unless...
no I was pretty much right
well ik that that's what i am doing
yes, which is why it wouldn't work
no you're converting a list of a split string to an int
xd
i mean the wrong thing wasn't the code
it works
well I printed it when I have a value error
I printed the start_pos[0]
umm
and it printed that instead of 49
1
now it is fixed
idk why
I did not change the code
im crossing my fingers that after waiting 5 min for part 2, my sol would be correct
yay, it's correct
Got part 1 no problem, got part 2 correct for the test case, but my answer keeps coming in to low. π
same
Slightly frustration
LMAOOOO
I ||COPIED BRESENHAM|| FROM WIKIPEDIA FOR PART1
ADDED AN IF CONDITION
REMOVED THE IF CONDITION
AND IT WORKS FOR PART2
I tried someone elses puzzle input, and compared it to their answer. I am still a few off from theirs but not by much. Now to figure out why its causing the issue.
yeah! good luck! I am worrying if i got the question wrong
for the example input I get 11 which is one away
which means maybe we both have the same issue but gl! Imma read second part more
(RE Part 2) Can someone please explain why position (0, 0) is a 1 and not 2 for linespy """ 8,0 -> 0,8 9,4 -> 3,4 2,2 -> 2,1 7,0 -> 7,4 6,4 -> 2,0 0,9 -> 2,9 3,4 -> 1,4 0,0 -> 8,8 5,5 -> 8,2"""Surely it should be 2 because 8, 0 -> 0, 8 and 0, 0 -> 8,8 would both include 0,0
Thats why I was frustrated. I got the example right. I added the difference I got from my solution and their answer and added it to my puzzle input and got it right. Which is weird, because my puzzle answer is several thousand higher then theirs. On their problem I was only 27 off. Thought i'd see what happend, and lo and behold it was correct.
how would they both include 0, 0?
points in 8,0 -> 0,8:
8, 0
7, 1
6, 2
5, 3
4, 4
3, 5
2, 6
1, 7
0, 8
hmm
That makes sense
Added (0, 0) for (8, 0) -> (0, 8)
Guess my code is just broken then lol
OH MY FUCKING GOD.
OH MY GOD
I WAS COUNTING FUCKING DIAGONALS FOR PART ONE
AND IM WONDERING WHY IT WASNT FUCKING WORKING
OH GOD
wao
damn nice! here me trying to figure out how do you pick diagonals ( not using coding just using my hand, and I still can not figure it out how it works )
Thanks, I figured out my issue π
that is a quite suspicious looking link
can't wait for quantum computers to come out and AoC speaking RSA
off to bed, but some quick thoughts: (1) are you recalculating the least/most common after you remove numbers? (2) are you removing numbers? π
When in doubt, test on the sample input and print every step of the process
gn
hello, I'm a beginner in Python and creating a hangman program. Say I have random word which is 'bear', which in turn will look like '---- '. My question is, how do I put the input from user to its specific index? like if the user input is 'r' which then prints as follows: '--- r'. Thanks!
Oh yes. Hangman
- hm, isn't this not #advent-of-code
- you can turn a string into a list of characters, and you can turn a list of characters into a string.
normal indexing would not work since you have >1 indexes, so you'd have to iterate over the list and turn stuff on/off to get what you want.
did y'all ||store the array of points or compute it mathematically?||
i just got to part 2 my head hurts
# undestand this please
# list comprehension - string -> list of bytes
str = "bear"
strlist = [c for c in str]
# make a list of 0s with the length of the string
switches = [0] * len(strlist)
# iteration for input stuff
def inputChar(c):
global switches # global vars
switchedAnything = False # hangman
for i in range(len(strlist)): # iterate i as an index from 0 to len(strlist)-1
if strlist[i] == c: # :)
switches[i] = 1 # if matched, then show a character
switchedAnything = True
return switchedAnything
def show(switches, strlist):
for i in range(len(strlist)):
# check if a char is "switched" or not
if switches[i] == 0:
print("-",end="") # print with the end of "", normally this will end in newline, but we'll change it to empty instead.
else:
print(strlist[i],end="")
print() # finally, a newline
Thanks!
sorry for using the wrong channel
this channel should be about Advent of Code, right?
#βο½how-to-get-help Please
im not sure if this is related, but there appears to be a rust kernel for jupyter
any idea why it's so damn slow (running it on wsl)
id like to use it for aoc
unless? π³ interpreted rust? π³
good job!
I still have yesterday to make... But i read the yesterday's task when going to bed and I think I have solution that will be relatively short without using numpy like @frigid zephyr suggested ;P
Nice
My partner was like "you don't have to care about complexity, you can just do it so-and-so", and I was like "I know, but I like doing it in few lines without explicit loops (implicit like comprehensions are fine, I just hate nesting)" :D
Done day 5 p1 and p2. Today felt much easier than yesterday but my code is super inelegant
I havenβt had a look at todayβs puzzles yet
Me neither. And I don't remember what my github password is (lol), so I'm not coding anything on my phone XD
I do like to look at puzzle on my phone, even if I wont' get around to it for a while
Probably if I knew what github's password requirements were, then I'd know what my password was
means my brain can crunch on it in the meantime
Because I remember that I had a realisation last time I reset it
This is off-topic, but it's thanks to GitHub that I avoided having my other accounts hacked
because my previous password that I used everywhere had been leaked
but GitHub runs all passwords through Have I Been Pwned
and warned me that the password had been leaked and that it was a good idea for me to change my passwords ASAP and use a new one on GitHub
use a password manager π
I've been using lastpass but they changed their free tier and you can either use it for mobile or for desktop, not both :c
And I remember some passwords anyway - they're not entirely random, just long af.
lol, we implemented this in a B2B app we make at work, and the amount of feedback we had from customers was incredible π Many of them didn't even know
https://haveibeenpwned.com/API/v3 is incredibly useful, yet secure, since you only share partial hashes the plaintext password never leaves the browser
oh yeah I love the way that API works. K-anonymity
did anyone use vectors
i used way too much nesting
Lets keep anything close to spoilers in #advent-of-code-spoilers-archive please
yes
yes
numpy has much more powerful and concise operations, making it very good for treating with AoC puzzles
it's not always about speed
that's what learning is for!
the sea monster π
yeah
i discovered using jupyter nbs for advent of code yesterday
day 2 of me being at #69 streak
makes my life much easier
eh?
eh to whom
u
ah
i normally skip school
same
but i cant skip weekends (they r important) so tht trashed my score
ive ended up sleeping 20 mins over the beginning of the last two days' puzzles
its sad cause like
Coaching seems enough to me
today i got the puzzle under 20 mins
(from the time i actually got to my computer of course)
since it covers both school level and high
i normally take like 30 minutes because i like to go slow and set up classes etc
be sure that itll work on first pass
So I usually don't go
ye me 2
ngl advent of code is very fun
me likey
ikr
nvm not related to aoc
Sure
Solved day 4 part 1 and am too lazy to modify my solution for part 2
Take nap grind backβ’οΈ
DONEEEE FINALY
i have zero idea what im doing at this point lmao

software engineers in a nutshell
sad = 0
while true:
sad += 1
if sad > 10:
break
if sad == 5:
continue
print(sad) ```
what's wrong here
SyntaxError - true must be uppercased
or titlecased, rather
probably nameerror right
but yeah, should be True
Yeah, NameError
Thanks
how many people do you guys predict will finish 50 stars before January?
I struggled for 20 mins, turns out I had messed the regex up 
Insert Jamie Zawinski regex quote here π
Some people, when confronted with a problem, think βI know, I'll use regular expressions.β Now they have two problems.
a fun math puzzle :D everything is getting 2-dimensional now lmao
hey, don't want anyone to reveal solutions to me (still working on the problem, woke up late lol), but the input has this line: 609,916 -> 60,367 which doesn't seem to make sense because neither of the coordinates stay the same, and i don't have a given way to round points to grid numbers
is there something i'm missing here
||not all the lines given will be useful, you have to determine which ones to use||
ah yes, when you try to define a parse_input function but writes the human posterior instead
toatly
although in this case i had seen ppl saying that it would need diagonals
me 2
lmao so true, yesterday's part 2 only took 5 minutes
i actually was about to do diagonals and had the logic thought out
but then noticed
"haha no diagonals tho"
same that's when I decided to create this meme
hey can I have some help me understand how diagonals work in this one?
for example: what are the points inside (0, 1) -> (1, 3)
you're guaranteed that there won't be diagonals like this, all diagonal lines will be inclined at 45 degrees
if it was (0, 1) -> (2, 3) it would be [(0, 1), (1, 2), (2, 3)]
π
@peak dock π
nice
:D
back
im stuck on part 2 from today :/ the logic on how do you know if its a potential diagonal line
well something went wrong
||45 degree lines will always have a slope of 1 or -1, that's how I approached it||
mkay
are we allowed to segment our code into multiple programs to prevent memory issues
or must the solution be able to run in a single file
you're allowed to do whatever you want to get an answer
oh ok
that's a lot of memory, do you have a huge array or something
diagonal lines (β―β΅β‘β²)β―οΈ΅β»ββ»
originally i was using numpy but then i decided to get rid of it and i forgot to remove one bit which was causing it to use that much
now im using half of that but its more stable
and now i understand why 64 bit is preferred over 32 bit
how did you filter out diagonal lines in part 1?
are all the others than the vertical and horizontal lines diagonal lines?
i dont think so
for my solution i basicaly just generated a list of all points in all lines and then counted the number of occurences of the same point using a dict
those are the only kinds of lines
i used a defaultdict
I assumed so
and I got the answer
so yes I guess
it was bad, but it worked well
hmmm
all lines are vertical, horizontal, and diagonal so yeah. also all diagonals have a slope of 1 or -1
mkay, im trying to put my head around this
or slope of 0 or infinity (horizontal and vertical) so one way to do it is ||have a dx and dy that increment from point 1 to point 2, dx and dy can be 1, 0, or -1||
true, although i was thinking -1 or 1 just for diagonals
that works too, but you can cover straight lines too with 0
pretty much got my solution working but it's being really slow fsr
using ||points = set(point for point in points if points.count(point) > 1)|| to get intersections and it's taking forever on the actual input because of how many points there are
is there a better way to do this?
what is your points object?
list of tuples (so smth like [(0, 0), (4, 5)...)
are these correct? im thinking about diagonals = ||5,5 -> 8,2 = (5,5), (6,4), (7,3), (8,2)||
i wouldent consider this better, but i generated a list of points that made up each line (||0, 0 -> 3, 3 = (0, 0), (1, 1), (2, 2), (3, 3)|| and then counted the number of times a point occured (after combining the lists of all points)
ah, you could try ||from collections import Counter; counts = Counter(points) then filter the ones that are 2 or more||
your slowness is coming from doing points.count so many times
alright, i'll try that
oh thats smart, my soution was to do a stupid thing with a dict to count them :|
well a dict rather than a list to count them from the start is a good approach
(β―Β°β‘Β°οΌβ―οΈ΅ β»ββ»
oops spoiler was broken
sorry anyone who saw that and dint want a spoiler
Try to keep these conversations in #advent-of-code-spoilers-archive 
@hollow wharf thanks, it works nearly instantaneously now lol
day 5 is so much FUN
why is this so FUN
i feel like a little child rapidly opening christmas presents with impatience every single day when i wake up and go straight to my phone for the latest puzzle
That's literally how Advent Calendars work
where is the problems?
how can I participate?
check #911684406605930496
I DID IT
in day 3 the most common hast to go from each line ?
like on [0] is lets say most common 0 so for [0] its 0 ?
or does it go in row
I'm not sure I read your question right, but I think you might be misunderstanding the problem (or I your question) can you say it again ?
finally :OOOO i had a typo i didnt see :XXXXX
:DDDDDDDDD
i and 1 look so similar with my eyes. i should consider incrementing the font size in VSCode π
So... this is the first time I'm participating in something like this and it's really helping me learn some things. Does anyone know of similar activities throughout the year, or is it just this one in December?
Suggest a program that generates an integer included in the interval 0; 10 (do not use another random number generator (randint ...)
help me pls i am a amateur
This channel is for Advent of Code, see #βο½how-to-get-help instead
There are a few others that aren't quite the same, but I recommend checking out Project Euler, Exercism, and DMOJ
note that there are 5 previous years worth of challenges to do on AoC - all of which are still available to do throughout the year π
While the challenges are up all year, the live chat as people discuss problems together really only happens as they're released. But there's still an active community on reddit on /r/adventofcode where we answer questions year round, as well as /r/learnpython and here on discord. I'm always happy to pull up an old problem from years ago.
Same - we get the odd Help Channel question on AOC here and I do the same thing
I'm actually quite curious. what is the general approach to 2020.20?
cry
understood, have a nice day
http://adventofrealizingicantread.com oh my... lol
can't reach site
lmao extremely amazing site
ikr
Lmao
my approach was use numpy π
for part 1, it's pretty easy you just need to find 4 tiles that have 2 edges that don't match any other tiles
for part 2 you'll actually have to assemble the whole image
I actually assembled the whole image for part 1
that trick completely went over my head
yeah same i only learned about finding the corners after i solved it and checked the chat here
so, in a way, I was happy part 2 relied on that
I would have felt like the biggest idiot ever if you didn't have to assemble the pic
i predicted i'd need the whole image
yeah lol, same with today's, i knew we ||were gonna need the diags||
I actually didn't mind 2020.20 . It wasn't difficult, it was just a slog
a lot of legwork involved in assembling the picture and then finding the monster
oh wait, i may have gotten it mixed up... what's the sea monster one?
that one lol
how does that have to do with sea monsters
you had tiles that made up the picture
at least i think part 1 doesn't
well, yeah, I did part 2 in part 1
same lol
Day 5 Maybe I'm not understanding the problem right.. for every point that has had 2 or more intersections.. this counts towards the total
and they were sea monsters?
they had sea monsters in the picture
oh lmao, that's so cool
the searching for the sea monster was the easy part
it's the tile assembly that was a pain
rotating and flipping tiles and trying to find edges that matched
I'm just lucky there were no situations where an edge could match with more than one other edge
if that had been the case I would have been so screwed
@low condor i just got your name's pun xD
I couldn't think up a Xmas themed one like everyone else
so I went with Harry Potter instead
Also no-one got Fiddle on the Roof, which is sad
perfect start to day 4
sir wut
I keep putting off learning how "arraymancer" works... people just tell me it's like numpy
fuckin numpy wont import
import numpy as pandas cursed
is that numpy won't import, or the intellisense for it won't import.
|||||
import pandas as numpy```
what theme is that
thats atom editor default one dark ig
hey guys, just curious, for day 3 part 2, do we have to do the equally common stuff? there wasn't any equally common for part 1 and we're using the same input
import networkx as np, numpy as pd, pandas as nx
7 minutes! Who's staying up? π
Well actually, some of you all might not be staying up haha
i am indeed staying up at 10:23 am
ah yes, an all nighter
yeah, its pretty hard
i wonder if playing music helps with solving AOC hm
all-morning-er
guess i'll try today
Yeah, I always thought it would make me fail trying to comprehend the prompt
Ah, I get in the zone when I listen to music, diff for everyone
Just setup fira code for ligatures so my eyes be pleased by my code
Although alacritty doesn't support ligatures, had to setup temp kitty terminal
Ah, some music helps me get into the zone
Crying
I should just play a lowkey but upbeat song, I think that'll help
Lofi βοΈ
see, when I listen to lofi, i zone out lol
You must be listening to some weird lofi
https://open.spotify.com/playlist/0vvXsWCC9xrXsKd4FyS8kM?si=fL33veHXSXSyppT1e3jYQA
this is the lofi I've tried listening to
it's just too background-y
That's the point
I need something that's more prominent
i don't like background music
find it distracting
Guess I'm the odd one out
i'll not play music for P1 but play it for P2, I wonder if that'll help
an experiment
i do that
lol
playing music during AOC is impossible
i have experimented
ποΈ π ποΈ
some swiftie songs
oh my god, I should listen to all too well (10 minute version)
ok now for real tonight if it's too difficult i'm saving it till tomorrow π
If it's to hard fuck it we doing all nighter
π€
yeet
I have school tomorrow but I guess I'll ruin my sleep schedule
lofi
Can't ruin a ruined sleep schedule
30s left
lol true
menacing
I've had too much caffeine today
why do i see red π
gl
cya when i'm done with P1
time to take 10 minutes parsing again
<@&518565788744024082> Good morning! Day 6 is ready to be attempted. View it online now at https://adventofcode.com/2021/day/6. Good luck!


