Ok you Python-using heathens. What did you think for difficulty this time around?
Post your coding atrocities below.
For those of you who missed the early signups. Feel free to join the leaderboard late (though rankings are based on time).
Ok you Python-using heathens. What did you think for difficulty this time around?
Post your coding atrocities below.
For those of you who missed the early signups. Feel free to join the leaderboard late (though rankings are based on time).
tech/science swag.
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 non-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!
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.
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.
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 real them at least once a month. We also reserve the right to ignore enforcement of the guidelines at the discretion of the janitorial staff. Be funny, or at least compelling, and pretty much anything legal is welcome provided it's on-topic, and even then.
Do not use outdated operating systems that are unsupported to access SN. What are you, poor?
[[[ 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. ]]]
Jump in the discussion.
No email address required.
HI PEOPLE HERE FROM THE STICKY
DONT WORRY ABOUT BEING LATE. LAST YEAR FINISHING EVERY DAY AT ALL WAS ALREADY TOP 10 PRETTY MUCH
JUST GET IT NOW AND DO IT WHEN YOU HAVE TIME
Jump in the discussion.
No email address required.
More options
Context
Alrighty, enough solutions have been posted that this won't be a major spoiler anymore.
Here's a nice, clean, Pythonic solution:
Jump in the discussion.
No email address required.
import num2words
Jump in the discussion.
No email address required.
Cry more. While you spent nine hours typing out the names of all the digits, my four hundred gigabyte python venv was already blasting through problems which haven't even been posted yet.
Jump in the discussion.
No email address required.
More options
Context
lol import problemsolver
Jump in the discussion.
No email address required.
More options
Context
"I used Python but had someone else solve it for me"
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Most based solution
Jump in the discussion.
No email address required.
More options
Context
i wonder if anyone realised what those characters meant
Jump in the discussion.
No email address required.
More options
Context
More options
Context
bash chads stay winning hahahahaha you fricking losers
Jump in the discussion.
No email address required.
Obscenely based, can't wait until day 18
Jump in the discussion.
No email address required.
im not even using bash in this one it's just shell
this isn't even my final form
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
one line of pure python
edit apparently there are two parts
also did part 2 in one line
Jump in the discussion.
No email address required.
More options
Context
I got both puzzles but don't laugh at my solution for the 2nd one
I've been very, very slowly teaching myself Python after learning Matlab at college
Jump in the discussion.
No email address required.
Everywhere that you think you need a tree of if/elif/else based on the same value you can use a dict:
Then you get the value using
val1 = val_map[val1]
or if you need a default, yourelse
here, use.get(key, default)
:Jump in the discussion.
No email address required.
zoz
Jump in the discussion.
No email address required.
zle
Jump in the discussion.
No email address required.
zozzle
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
That's a better example of the use of a dictionary than anything those coding bootcamps told me
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Proud of you, little buddy.
Jump in the discussion.
No email address required.
More options
Context
Never be ashamed of your solution if it gets the work done.
Especially since your solution is clean and understandable by everyone. Sure it's a bit convoluted, but who cares ;)
Jump in the discussion.
No email address required.
More options
Context
Part 2 solution is keyed, ignore the haters
Jump in the discussion.
No email address required.
More options
Context
I think your solution for the second one is really cute. In the future you can just use rfind though.
I love the little word games some people play with it to get it to work
Jump in the discussion.
No email address required.
More options
Context
More options
Context
My solution is nothing special (maybe a little bit inefficient but who cares)
@L this can be used to generate images of code https://carbon.vercel.app
Jump in the discussion.
No email address required.
The O(logn) virgins fear the O(n^2) chad
Jump in the discussion.
No email address required.
More options
Context
I'll put it in my template for tomorrow. I'll actually be able to post code then too since it's a weekend.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Jump in the discussion.
No email address required.
you didnt answer me last year so im gonna ask again, do you own an apl keyboard? i cant imagine trying to write apl without one but i also cant imagine learning how to use one.
Jump in the discussion.
No email address required.
I use a regular physical board (right ctrl to switch layouts) with the layout open in a terminal:
You barely look at the keyboard when you're typing anyway.
Jump in the discussion.
No email address required.
neat, ty
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
you got me into it. i started learning dyalog a few days ago. i wanted to play with the bitmask aspect of it so i did this
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Got ugly once I spotted the portmaeaus
Jump in the discussion.
No email address required.
Oh I like this one
Jump in the discussion.
No email address required.
More options
Context
clever
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Regex is king:
Side note: Nim has a nice bit of syntactic sugar for matching regexes:
However, it will only use an existing
matches
array if it's declared in the enclosing scope, not any scopes above it. This means the array would be recreated every loop cycle, making it several times slowerJump in the discussion.
No email address required.
literally, For the first:
For the second:
Got pretty much the same thing, but couldnt figure out how to do a backward regex cause I suck at regex but go off i guess
Jump in the discussion.
No email address required.
More options
Context
Regex is the way, but I completely admit to getting stuck for a minute because I forgot about match consumption and lookahead and all that shit that you tend not to think about from day to day: https://stackoverflow.com/questions/11430863/how-to-find-overlapping-matches-with-a-regexp
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Maybe c++ is not the right choice for this.
Jump in the discussion.
No email address required.
There's a LOT of file parsing involved. But I think if you keep building a library of all these functions by the end of the month and reusing them it won't be horrible
Jump in the discussion.
No email address required.
More options
Context
wtf.. pretty sure i can do it in C with a few for loops I think you overdid it a bit there lmao
Jump in the discussion.
No email address required.
More options
Context
More options
Context
was nice that he threw in the "word numbers can actually be portmanteaus" bit cause it made it not braindead, but i feel like there will be a lot more of this trickery
oh wait i didnt even use islice after all
Jump in the discussion.
No email address required.
Wait that rule was there? I didn't do it either lmao
Jump in the discussion.
No email address required.
my example data for p2 was
i didnt want to think about trying to handle shit like
eleven
,twelve
, andthirteen
because they are gay edge cases but it never came up so ime assuming the-teen
suffixes were dropped in to bait peopleJump in the discussion.
No email address required.
Oh I thought you said palindrome whoops
Yeah the text explicitly said only up to 9 was considered. It's an English test
Jump in the discussion.
No email address required.
wait did it?
Jump in the discussion.
No email address required.
Yeah it gave a very clear list
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
More options
Context
More options
Context
vomited the ugliest, least efficient or concise or consistent code I could and I was still so SLOW
<4 mins for p1 and 34 mins for p2
Jump in the discussion.
No email address required.
I thought you meant the shitty vomit code took 34 minutes to execute at first and I was almost impressed
Jump in the discussion.
No email address required.
That would be like that old chess game from the early 90s where if you turned up the "AI" it just intentionally took like a minute to "figure out" its move.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
Wait the rankings are based on time that is so f****** gay I'd have to get up at like 1:00 in the morning to compete f*** that
Jump in the discussion.
No email address required.
This was last years. If you do it at all you'll be fine even if it's late
Jump in the discussion.
No email address required.
More options
Context
There's major burnout around day 10 or so. Last year, day 12 was some pathfinding thing. I was on vacation, and I had spent a couple hours on it, and like a lightbulb going off over my head I was like "what in the frick am I doing with my spare time?" and I quit. I have a feeling that's a pretty typical experience with this thing unless you're hardcore.
Jump in the discussion.
No email address required.
More options
Context
"Get up" 🤔🤭
Jump in the discussion.
No email address required.
I go to bed at 7pm
Jump in the discussion.
No email address required.
Based boomersleeper.
Jump in the discussion.
No email address required.
it keeps my complexion healthy
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
More options
Context
Jump in the discussion.
No email address required.
More options
Context
Am I just r-slurred or is there not enough information for the second part? I don't know if characters can be reused or not, IE is eightwo interpreted as 82 or 8wo
Jump in the discussion.
No email address required.
In your example eightwo is 82 (8 is the first number, 2 is the last number)
Jump in the discussion.
No email address required.
More options
Context
More options
Context
std::string
fan vsstd::string_view
enjoyerJump in the discussion.
No email address required.
More options
Context
1/5 Imma just read the file and add them all up
Jump in the discussion.
No email address required.
brain++
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Fear my shitcode. Sepples returning -1 on not finding stuff fricked me for the longest time and I kept adding bloat trying to compensate for things I thought might be causing the issue
Got it working though, I'm shaking the rust off bros
Jump in the discussion.
No email address required.
More options
Context
Took me a long time to remember to do this but I beat the release of day two :)
I bounced off haskell immediately and cbf re-learning from scratch so it's rust season again:
Jump in the discussion.
No email address required.
I have to say rust is less ugly than I thought it'd be. Why did they choose
let var: Type = ...
instead of justType var = ...
?Jump in the discussion.
No email address required.
Most of the time it will infer the type from what's passed in/used later, but yeah shit can get cluttered
Jump in the discussion.
No email address required.
More options
Context
More options
Context
You had a chance to not be completely worthless, but it looks like you threw it away. At least you're consistent.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Ugly but it works.
Jump in the discussion.
No email address required.
More options
Context
You would like to know my secrets, wouldn't you, filthy silvercel?
Jump in the discussion.
No email address required.
More options
Context
what is this btw
Jump in the discussion.
No email address required.
Fistmas themed coding puzzles.
https://adventofcode.com
Join the rdrama leaderboard with code
2416137-393b284c
.Jump in the discussion.
No email address required.
ez
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
Oh shit, it's that time of the year already?
Python was too easy last year, so this time I'm using C++.
Jump in the discussion.
No email address required.
so you must have made the leaderboard every day, huh?
Jump in the discussion.
No email address required.
The challenges open at 5am my time so frick that noise.
My personal goal is just to get all the stars within 24 hours of them dropping.
Jump in the discussion.
No email address required.
neighbor you stay up til 3am anyways, wtf do you care?
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
Jump in the discussion.
No email address required.
More options
Context
It's nothing good. I'm trying to learn a faster language and I picked Rust because I really like their package manager. I'd rather use C tbh, I've tried it before and prefer it, but everytime I try to use Cmake I have the urge to kill whoever designed it.
I might go back and do the second part later
Jump in the discussion.
No email address required.
More options
Context