Expand Cut Tags

No cut tags
[personal profile] hoisinsauce posting in [community profile] secretfanspace
I TAKE IT BACK, GO BACK TO FUCKING THE HOUSE!

(https://secretfanspace.dreamwidth.org/2511.html?thread=3560655#cmt3560655)

Welcome back! Chat fandom, weird internet stuff, creative work, games, books, anything! Meme listens, and sometimes even replies!

(start a comment thread by replying to this post)
Depth: 1

Re: Coding

Date: 2024-12-04 09:07 pm (UTC)
From: (Anonymous)
I felt like my solution to day four was very verbose and clunky, and then I looked at some reddit solutions and immediately felt better about how I had organized everything.
Depth: 2

Re: Coding

Date: 2024-12-04 10:48 pm (UTC)
From: (Anonymous)
My AoC code is always the worst code ever seen. I operate with no rules. Everything is a script; functions are for stuffy bureaucrats. Code is duplicated everywhere in sight. Every other line is a debugging #print statement, and getting the final answer involves ignoring the 60 irrelevant printed variables to find the right one *somewhere* on the terminal screen. Did I hardcode the digits from 0 to 9 as strings for one of the days? You betcha! I couldn't be bothered to look up the syntax for a range. I knew I'd fuck it up, and then have to look it up, so I just typed "0","1","2","3","4","5","6","7","8","9". Sometimes when my answer's wrong, I try it +-1 just in case I've got an off-by-one error.

I finally did day2. turns out that if you do list.remove[i], that doesn't remove the thing at index i, it removes the first thing in the list matching the value at index i. +_+ Am deceased. Changed it to pop() after fucking HOURS, got my star; learn from my error, o innocent youth
Depth: 3

Re: Coding

Date: 2024-12-04 10:52 pm (UTC)
From: (Anonymous)
* that is, list.remove(list[i]). And, tbf, I feel like I already knew about this, but I still always forget this kind of awkward language-specific stuff. I just get left with a vague memory that there's something annoying about list removal...
Depth: 4

Re: Coding

Date: 2024-12-04 11:03 pm (UTC)
From: (Anonymous)
"but obviously list.remove(list[i]) is going to evaluate list[i]!"

now listen here u little

but anyway, the way this happens is simple. you don't start off with list.remove(list[i]) . you try a few variants and get syntax errors until you blunder your way into list.remove(list[i]), or if you're really lucky, list.remove(list[:][i]). at this point, it seems to work, and you're so relieved you don't even notice how fucking stupid your code has got. Then, it silently almost-works, for hours. Your test input works. The part 1 input works. Your part 2 answer looks plausible, but the website disagrees. You cry. Your friend finishes and goes off to do fun stuff. You can't figure out why the computer hates you. You're nice to the computer. You give it more attention than anyone else in your life. Why is it LIKE this?

plus i hate pop() because it returns the removed element and that always catches me out because i expect it to be like " X = 'abcde', Y = X.pop('d'); Y is 'abce'", but no, Y is 'd'! X has changed value! I hate it when things change value without being explicitly set to a new value!
Depth: 3

Re: Coding

Date: 2024-12-04 11:09 pm (UTC)
From: (Anonymous)
SD

Though you should see my friend's day 4 solution. I did it the easy (albeit inelegant) way. Friend didn't see how to do it easily, so went on an adventure involving regexps and even perl! He doesn't even KNOW perl; he was like 'I searched the internet, and it was the only thing that knew how to do what I needed'. The way he treated his input reminded me of the way a CRT TV screen works. It took him hours. He got the right answer. He just about wanted to cry when I showed him how I did it. xDDDD

Profile

secretfanspace: A happy spidermite, still forbidden, just without 'no' visible (Default)
Anon fandom messageboard

May 2025

M T W T F S S
   1234
567891011
12131415161718
19202122232425
2627282930 31 

Page Summary

Style Credit

Page generated Feb. 8th, 2026 11:48 am
Powered by Dreamwidth Studios