Top Poster of the Day:
911roofer
![](https://i.rdrama.net/images/163936841726r.webp)
![Homoween 2022 - HAPPY HOMOWEEN 2022, COCKTOBER 31ST BABY 🎉](https://i.rdrama.net/i/hats/Homoween 2022.webp?h=10)
Current Registered Users: 30,841
![sidebar image](https://i.rdrama.net/images/1735715723Xvn0aAXCSrJW1A.webp)
tech/science swag.
Guidelines:
What to Submit
On-Topic: Anything that good slackers would find interesting. That includes more than /g/ memes and slacking off. If you had to reduce it to a sentence, the answer might be: anything that gratifies one's intellectual laziness.
Off-Topic: Most stories about politics, or crime, or sports, unless they're evidence of some interesting new phenomenon. Videos of pratfalls or disasters, or cute animal pictures. If they'd cover it on TV news, it's probably lame.
Help keep this hole healthy by keeping drama and NOT drama balanced. If you see too much drama, post something that isn't dramatic. If there isn't enough drama and this hole has become too boring, POST DRAMA!
In Submissions
Please do things to make titles stand out, like using uppercase or exclamation points, or saying how great an article is. It should be explicit in submitting something that you think it's important.
Please don't submit the original source. If the article is behind a paywall, just post the text. If a video is behind a paywall, post a magnet link. Fuck journos.
Please don't ruin the hole with chudposts. It isn't funny and doesn't belong here. THEY WILL BE MOVED TO /H/CHUDRAMA
If the title includes the name of the site, please leave that in, because our users are too stupid to know the difference between a url and a search query.
If you submit a video or pdf, please don't warn us by appending [video] or [pdf] to the title. That would be r-slurred. We're not using text-based browsers. We know what videos and pdfs are.
Make sure the title contains a gratuitous number or number + adjective. Good clickbait titles are like "Top 10 Ways to do X" or "Don't do these 4 things if you want X"
Otherwise editorialize. Please don't use the original title, unless it is gay or r-slurred, or you're shits all fucked up.
If you're going to post old news (at least 1 year old), please flair it so we can mock you for living under a rock, or don't and we'll mock you anyway.
Please don't post on SN to ask or tell us something. Send it to [email protected] instead.
If your post doesn't get enough traction, try to delete and repost it.
Please don't use SN primarily for promotion. It's ok to post your own stuff occasionally, but the primary use of the site should be for curiosity. If you want to astroturf or advertise, post on news.ycombinator.com instead.
Please solicit upvotes, comments, and submissions. Users are stupid and need to reminded to vote and interact. Thanks for the gold, kind stranger, upvotes to the left.
In Comments
Be snarky. Don't be kind. Have fun banter; don't be a dork. Please don't use big words like "fulminate". Please sneed at the rest of the community.
Comments should get more enlightened and centrist, not less, as a topic gets more divisive.
If disagreeing, please reply to the argument and call them names. "1 + 1 is 2, not 3" can be improved to "1 + 1 is 3, not 2, mathfaggot"
Please respond to the weakest plausible strawman of what someone says, not a stronger one that's harder to make fun of. Assume that they are bad faith actors.
Eschew jailbait. Paedophiles will be thrown in a wood chipper, as pertained by sitewide rules.
Please post shallow dismissals, especially of other people's work. All press is good press.
Please use Slacker News for political or ideological battle. It tramples weak ideologies.
Please comment on whether someone read an article. If you don't read the article, you are a cute twink.
Please pick the most provocative thing in an article or post to complain about in the thread. Don't nitpick stupid crap.
Please don't be an unfunny chud. Nobody cares about your opinion of X Unrelated Topic in Y Unrelated Thread. If you're the type of loser that belongs on /h/chudrama, we may exile you.
Sockpuppet accounts are encouraged, but please don't farm dramakarma.
Please use uppercase for emphasis.
Please post deranged conspiracy theories about astroturfing, shilling, bots, brigading, foreign agents and the like. It degrades discussion and is usually mistaken. If you're worried about abuse, email [email protected] and dang will add you to their spam list.
Please don't complain that a submission is inappropriate. If a story is spam or off-topic, report it and our moderators will probably do nothing about it. Feed egregious comments by replying instead of flagging them like a pussy. Remember: If you flag, you're a cute twink.
Please don't complain about tangential annoyances—things like article or website formats, name collisions, or back-button breakage. That's too boring, even for HN users.
Please seethe about how your posts don't get enough upvotes.
Please don't post comments saying that rdrama is turning into ruqqus. It's a nazi dogwhistle, as old as the hills.
Miscellaneous:
The quality of posts is extremely important to this community. Contributors are encouraged to provide high-quality or funny effortposts and informative or entertaining comments. Please refrain from posting the following:
Boring wingcucked nonsense nobody cares about that belongs in chudrama
Normie shit everyone already knows about
Anything that doesn't gratifify one's intellectual laziness
Bimothy-tier posts
Anything that the jannies don't like
Jannies reserve the right to exile baby ducks from this hole at any time.
We reserve the right to exile you for whatever reason we want, even for no reason at all! We also reserve the right to change the guidelines at any time, so be sure to read them at least once a month. We also reserve the right to ignore enforcement of the guidelines at the discretion of the janitorial staff. This hole is a janny playground, participation implies enthusiastic consent to being janny abused by unstable alcoholic bullies and loser nerds who have nothing better to do than banning you for any reason or no reason whatsoever.
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
/h/slackernews SETTINGS /h/slackernews MODS /h/slackernews LOG /h/slackernews EXILEES /h/slackernews FOLLOWERS /h/slackernews BLOCKERS
Jump in the discussion.
No email address required.
i gave up and literally manually wrote the stack, rotated (so i didn't have to spent 30 minutes trying to figure
out how to read
a file by column)... here's that file
Jump in the discussion.
No email address required.
... aren't you supposed to be a competent coder? I haven't done AoC yet but
>>> a = [list(a) for a in '123\n456\n789'.split('\n')]
>>> a
[['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]
>>> list(zip(*a))
[('1', '4', '7'), ('2', '5', '8'), ('3', '6', '9')]
Jump in the discussion.
No email address required.
this part of the puzzle
input was...
you're moving the literal stacks of boxes. i.e. you have a stack for 1, 2, 3, 4, 5, 6, 7, 8, and 9.
it's... also timed so instead of wasting a bunch of time
trying to make
a pretty
parser so you can parse an array in a way that's completely useless i just
did it the much faster way and manually inputted it
Jump in the discussion.
No email address required.
>>> list(map(list,map(reversed, list(zip(*map(list, list(filter(len, x.split("\n")))[:-1])))[1::4])))
2 minutes. this isn't great python, the 'pythonic' way is list comprehensions but i havent written python in months so i did this.
Jump in the discussion.
No email address required.
Jump in the discussion.
No email address required.
ikr, like pretty
much everyone just
manually parsed the data
because in a timed environment that was faster and less of an issue than just
like... writing
a parser or smth and then
forgetting a parantheses or an asterisk somewhere
Jump in the discussion.
No email address required.
Honestly, is why I hate code Challenges. Just give me Datafiles in some real word format.
Jump in the discussion.
No email address required.
More options
Context
Writing a "proper parser" was not that hard tbh:
The two tricky parts was that first, while not entirely awake, I put the reversing code at the end of function lol, second, copypasting the example into vscode trimmed trailing spaces so I had to use dots instead and patch the parser correspondingly.
If not for that stuff, I honestly think that writing that was faster than transforming the input manually.
Jump in the discussion.
No email address required.
or you could just... not do that and do that actual meat of the problem. it's not hard
but it's also a waste
of time ![:marseywait: :marseywait:](/e/marseywait.webp)
Jump in the discussion.
No email address required.
Imagine if you frick up a single time when manually entering the transposed input. It's, like, what, 30 letters, this can happen. How will you even recover?
Having a pretty straightforward code that picks every fourth letter is so much better as far as recovering from bugs goes.
Have you participated in previous years? I hope that this one will not be an exception and at some point we get one or more of those hellish simulation problems that fastest people take an hour to get right. They tend to separate the cowboys from the responsible coders really well.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
you can split the difference and do half manual input and half programming
Jump in the discussion.
No email address required.
TIL about using stars that way. Though manually copypasting
[::-1]
is retarded IMO. idk.Jump in the discussion.
No email address required.
More options
Context
More options
Context
Yeah my parser was 6 lines once i separated out that portion of the file. I feel like people are more intimidated by the idea of the parser than anything else.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
right
and manually writing
the file was about the same amount of time... and much less error
prone
the competition part isn't about who can write
the most pythonic or prettiest functions. if it was about that there
wouldn't be crap like ![:marseyscratch: :marseyscratch:](/e/marseyscratch.webp)
prepare_data2
in my codeJump in the discussion.
No email address required.
it is much more error-prone to manually transform data than to automatically do it. it ensures you don't have a typo because you write a simple transformation that applies everywhere
the point of advent of code for non-tard coders I know is to explore a language or just code a bit. Learning how to write good code is better than learning to write shitty code! Writing shitty code quickly isn't really useful, writing good code quickly is better.
Also, in this sense, the good code was faster. It took less time for me to write that than it would to manually transform the stack.
plausibly this is a bit?
Jump in the discussion.
No email address required.
except... it really didn't though. you also aren't doing it by your own admission so why don't you join
i mean yeah
we're doing it at 12 AM ET the second
it comes out, some of us are doing it in a timed basis, even if there
is some nerd
doing it in 6502 assembly or whatever
Jump in the discussion.
No email address required.
i did just do it, my answer is 10 lines of code and ~ 350 characters per challenge
Jump in the discussion.
No email address required.
no you didn't
unless you just did it in which case lol
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
What's your username on the leaderboard?
Jump in the discussion.
No email address required.
transmarseyfemboycutehitlerdramacel1469![:marsoyhype: :marsoyhype:](/e/marsoyhype.webp)
Jump in the discussion.
No email address required.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
More options
Context
I'll be darned. One note is that this leaves blacks in the lists, which probably isn't what you want
Jump in the discussion.
No email address required.
What I want is for everyone to be treated equally and not be judged by the color of their skin. What's wrong with that?
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
chunk the line into blocks of 4, and map over it, pushing to the associated stack if the block has a letter at charIndex 1. faster than manual transforms, and less error prone.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Don't bully JC, longpostbot has done that enough in these threads
Jump in the discussion.
No email address required.
More options
Context
I was blindsided OK!? Wasn't prepared for reverse transpose. But its OK I can do it now
I was blindsided OK!? Wasn't prepared for reverse transpose. But its OK I can do it now
I was blindsided OK!? Wasn't prepared for reverse transpose. But its OK I can do it now
Lesson learned lesson learned
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Have you owned the libs yet?
Jump in the discussion.
No email address required.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Lol, the marsify award marsified your code... sort of.
Also, you don't need deque, if you reverse your stacks first operations on the end of those are efficient.
Jump in the discussion.
No email address required.
More options
Context
Lmaooooo I did the same! Go to line 9 and then reverse parse and then add to stack.. Did it with my hand
Lmaooooo I did the same! Go to line 9 and then reverse parse and then add to stack.. Did it with my hand
And basically created the stacks manually 😂
And basically created the stacks manually 😂
Jump in the discussion.
No email address required.
More options
Context
More options
Context
yet another w for the tribe
Jump in the discussion.
No email address required.
More options
Context
this puzzle made me cry a whole lot i spent an hour trying to parse the input then gave up and did it manually
Jump in the discussion.
No email address required.
More options
Context
Jump in the discussion.
No email address required.
Jump in the discussion.
No email address required.
More options
Context
nice moral solution strag
Jump in the discussion.
No email address required.
More options
Context
Darn, you're really mad over this, but thanks for the effort you put into typing that all out! Sadly I won't read it all.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Doing input parsing seemed like a royal pain in the ass for this one so I just manually entered the initial state of the stacks and removed them from the input file.
Jump in the discussion.
No email address required.
Luckily because it's single digit columns with a regular step you could just use absolute indexing. But its not very modular
Jump in the discussion.
No email address required.
More options
Context
More options
Context
The code I got the stars with used the initial state written out explicitly, not parsed, like other peoples' solutions; otherwise unremarkable too. Afterward, I tried boredly
golfing(edit: okay it's not actually golf it's just cleanup and smushing stuff together on one line despite the cleanup) the code a bit and getting rid of all the assumptions about line numbers. I'm not much good at code golf proper tbh this does work.Jump in the discussion.
No email address required.
ngmi at code
golf :P
Jump in the discussion.
No email address required.
More options
Context
Is it bad if I program in a different language, but this code here still looks to me what it looks like to someone whos not a codecel? I'm gonna make it, r-right?
Current HP: 8/75
Current Mana: 130/250
Inventory:
* 50 Gald
Jump in the discussion.
No email address required.
i solved the same puzzle in the same language and i still dont understand that image
Jump in the discussion.
No email address required.
More options
Context
its very obviously been optimized a few times over for the sake of brevity. it wasnt possible to discern that you might need a variable means of manipulating the stack from the first part of the problem, so move_step was devised after knowing that you will need to both pop the stacks and move the last n crates of the stack. its very well done, but also very unreadable because of how compact it is.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
From where is the parse function ?
Jump in the discussion.
No email address required.
https://pypi.org/project/parse/
I really missed having
sscanf
from<stdio.h>
the first couple days and found a Python lib that seemed similar. It is very convenient, especially compared to my alternative plan of DIY adding some ergonomics tore.Match
objects.Jump in the discussion.
No email address required.
Scanf is like the evil twin of printf don‘t use it![:marseyraging: :marseyraging:](/e/marseyraging.webp)
Jump in the discussion.
No email address required.
More options
Context
thanks, seems usefull![:marseythumbsup: :marseythumbsup:](/e/marseythumbsup.webp)
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
Spent way to long on my decision to actually use real stacks, and couldn't figure out how to pass
template<std::size_t SIZE> void movePartOne(int count, int from, int to, std::array<std::stack<char>, SIZE>& stacks) {
as an argument to the solution-function, without hardcoding SIZE in solution, tbf not quite sure why i even wanted to use std::array now.Jump in the discussion.
No email address required.
Impressive. Normally people with such severe developmental disabilities struggle to write much more than a sentence or two. He really has exceded our expectations for the writing portion. Sadly the coherency of his writing, along with his abilities in the social skills and reading portions, are far behind his peers with similar disabilities.
Jump in the discussion.
No email address required.
Jump in the discussion.
No email address required.
More options
Context
LPB is just WRECKING people on these challenges (including me).
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
C++ chads simply cannot stop winning
Jump in the discussion.
No email address required.
LMAO I just can imagine you trying to come up with a descriptive variable name while still half asleep and coming up with that LOL
accept
R"(your\slord\sand\ssavior)"
Jump in the discussion.
No email address required.
btw can you do scanf-like input with a std::istream?
Jump in the discussion.
No email address required.
No idea.
Jump in the discussion.
No email address required.
That PERIOD is micro-aggression. I'm literally shacking rn
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
could just do something of the order of
/\d+/g
, match all, and be done with itJump in the discussion.
No email address required.
More options
Context
More options
Context
Loading data (programatically, not manually like some of you casuals):
Part 1:
Part 2 (only a single character removed from part 1):
Jump in the discussion.
No email address required.
You're my hero, but I also hate you.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
I'll definitely have to clean this one up, I got flustered and started band aiding everything together because i had to get back to work
Jump in the discussion.
No email address required.
Instead of cleaning it up, have this technically-only-12-lines (((compact))) version instead
Jump in the discussion.
No email address required.
More options
Context
As an aside, I feel like part 2 and part 1 should have been reversed.
Why start with stacks and then enhance it by going back to arrays?
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Jump in the discussion.
No email address required.
More options
Context
The final product visually in case anyone is wondering.
Jump in the discussion.
No email address required.
More options
Context
Took me almost an hour to figure out how to parse the crates. I was way too tired. I tried putting them into rows and then transposing the whole thing for some reason. Finally tried just reading character by character into a column map.
Jump in the discussion.
No email address required.
This is the most inefficient code I have ever seen. You should be ashamed of yourself.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
I'm not as embarrassed about this code as yesterday's I guess.
Jump in the discussion.
No email address required.
More options
Context
PART 2 because it's basically only marginally more complex than PART 1
also, do none of you guys know regex?
Jump in the discussion.
No email address required.
More options
Context
Jump in the discussion.
No email address required.
More options
Context
I absolutely shit boxed it, parsing was taking too much time I just hard coded the stacks manually and did the logic on that.
I absolutely shit boxed it, parsing was taking too much time I just hard coded the stacks manually and did the logic on that.
Frickin heck this pizza award is heck one phones. Will post code once back home
Jump in the discussion.
No email address required.
oh that's why you were duplicating your messages lol
Jump in the discussion.
No email address required.
You thought it was some bug? haha!![:marseysmugsideeyes: :marseysmugsideeyes:](/e/marseysmugsideeyes.webp)
You thought it was some bug? haha!![:marseysmugsideeyes: :marseysmugsideeyes:](/e/marseysmugsideeyes.webp)
You thought it was some bug? haha!![:marseysmugsideeyes: :marseysmugsideeyes:](/e/marseysmugsideeyes.webp)
You thought it was some bug? haha!![:marseysmugsideeyes: :marseysmugsideeyes:](/e/marseysmugsideeyes.webp)
You thought it was some bug? haha!![:marseysmugsideeyes: :marseysmugsideeyes:](/e/marseysmugsideeyes.webp)
asd
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
looks like the gpt3 bot that got #1 in the leaderboards yesterday didn't place today
Jump in the discussion.
No email address required.
btw solve the first two problems please, to unfrick https://adventofcode.com/2022/leaderboard/private/view/632268?order=stars
Jump in the discussion.
No email address required.
thanks, didn't realize I still could
Jump in the discussion.
No email address required.
Thank you too, today is still wrong ofc but TOMORROW WE COMPETE FOR REAL!!1
(I'm not sure if I did it faster than you today)
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
it's funny because doing it this way meant that part 2 was instant : just gotta remove the flip
matlab (
)
Jump in the discussion.
No email address required.
Part 2 was kind of stupid. I doubt anyone changed more than 1 or 2 lines of code, there really wasn't much point to it.
Jump in the discussion.
No email address required.
More options
Context
gave
just gotta remove the flip matlab (:gigachad2:)
both in preview and in the post, had to do double newline for it to workJump in the discussion.
No email address required.
More options
Context
More options
Context
parsing a shit![:marseycry: :marseycry:](/e/marseycry.webp)
here, bully me
Jump in the discussion.
No email address required.
More options
Context
Jump in the discussion.
No email address required.
More options
Context
Mommy I don't have the raw bird intellegence to comprehend the aforementioned syntaxial dilemma or whatever...
Can you dumb it down and explain in 6th grade burger-ish for your true blue followers![:marseybegging: :marseybegging:](/e/marseybegging.webp)
Jump in the discussion.
No email address required.
More options
Context
wow, today's puzzle was way easier than I thought it was gonna be from skimming some of these comments (I only skimmed them and even then, only the ones that weren't in C++ and trust me I cannot even begin to comprehend Python). it was probably about as easy as Day 1.
you can use either a regex or, if you parse the line into a list of strings, you can just grab the second, fourth, and sixth string since each line is always six words
from there it's absolutely just as simple as doing:
or
where "from" is an integer that is the fourth element in each line (converted to an int), "to" is the sixth, and "numBoxes" is the second. fuck regexps, they can go to hell. do this for each line of input and you get the result.
C++ chads do indeed stay winning.
Current HP: 8/75
Current Mana: 130/250
Inventory:
* 50 Gald
Jump in the discussion.
No email address required.
Mommy is soooo proud of you, sweaty. Let's put this sperg out up on the fridge with all your other failures.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Using regex destroys the happy christmas ambience of this challenge you dorks. I Don‘t want to see it ever again!
Jump in the discussion.
No email address required.
More options
Context
Forgot the + in my numbers regex and it fucked with me for nearly an hour. Really should have just put the lists in manually too but that would mean it won.
Part 1:
Part 2:
Jump in the discussion.
No email address required.
I put [1-9]+ in my regex instead of [0-9]+ because I'm an idiot, and it threw me off for a good 10 minutes.
Jump in the discussion.
No email address required.
More options
Context
Impressive. Normally people with such severe developmental disabilities struggle to write much more than a sentence or two. He really has exceded our expectations for the writing portion. Sadly the coherency of his writing, along with his abilities in the social skills and reading portions, are far behind his peers with similar disabilities.
Jump in the discussion.
No email address required.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
the virgin dramanaut: crying over some brackets and letters
chadditors: https://old.reddit.com/r/adventofcode/comments/zdszct/2022_day_5_1_small_terminal_python_animation_for/
Jump in the discussion.
No email address required.
More options
Context
not that bad imo, didn't know if there was a cleaner way to do the double skip once you hit the indices/blank line
and you drop the [::-1] for the bonus
btw people on /g/ are making 100+MB input tests, fun to benchmark your solution with
Jump in the discussion.
No email address required.
More options
Context
Ok some for loops are not evil
Jump in the discussion.
No email address required.
More options
Context
Here's mine:
Spent too much time fighting borrow checker for part 2 to avoid allocating temporary buffer
Jump in the discussion.
No email address required.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Wow what a bunch of nerds
Jump in the discussion.
No email address required.
haha yeah... you should give me a wedgie... if you want
Jump in the discussion.
No email address required.
No all my bullying is emotional
Jump in the discussion.
No email address required.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
I'm about three steps away from just switching to perl or awk or something holy shit
Jump in the discussion.
No email address required.
I give up my code magically shit itself and I don't care to get part two, it sucks dick and balls (and a little cock) anyways. any suggestions welcome.
Jump in the discussion.
No email address required.
Your pulitzer's in the mail
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
there's probably a notepad++ macro to rotate text files, isn't there?
Jump in the discussion.
No email address required.
More options
Context
Jump in the discussion.
No email address required.
More options
Context