AnnouncementsFunnyVideosMusicAncapsTechnologyEconomicsPrivacyGIFSCringeAnarchyFilmPicsThemesIdeas4MatrixAskMatrixHelpTop Subs
3

https://adventofcode.com/2024/day/2

Cool. We got 2 submissions on day 1. Let's keep it up. I'd really love to see everyone try one.

This one is very easy.

Comment preview

huh, if i have time tomorrow i'll try their problem in rock star, maybe? https://codewithrockstar.com/online.html

[-]x0x7
0(+0|0)

That will be interesting because these do get harder. Some of them basically make you implement a programming language. So it will be an eso-lang implemented in an eso-lang.

[-]happytoes1(+1|0)

I took a crude approach to part two. I had a function to check if a list of numbers was safe, so I just ran it on all the lists with one missing. If the list was (a b c d e), I ran it on (b c d e), (a c d e), (a b d e), and (a b c e). Somehow, I missed that code wasn't doing the fifth case (a b c d) so I got it wrong :-(

Fixed the bug, and it worked :-)

[-]x0x7
0(+0|0)

Nice. So you just knocked it out in the REPL?

Crude is my style for these.

[-]happytoes1(+1|0)

EMACS and SLIME. EMACS is notorious. SLIME is Superior Lisp Interaction Mode for Emacs, basically just a nice REPL.

I type my code into a file, there are key-chords to send function definitions to the REPL, and I try them out. My style is strangely mixed. Look at Guzzle Puzzle, my code for slurping up the data and parsing it. It has long comments, like I'm intending to keep and maintain the code. But it is really because I've had serious health problems and am terrified of getting so tired that forget what I was doing and cannot work out what I was thinking of when I wrote the code.

Or look at the function SAFE in day2. It is going to check a list of numbers. It assumes that there are at least two numbers in the list, so that it can seed the helper function with a first number and all the rest. I've typed in run-time type checks. But I'm mostly just knocking it out in the REPL, so why?

Partly paranoia. What if the data set, (which is big, I've not eyeballed it) has lines with just one number? I'd love to get a sensible error message. Mostly though, its a kind of mental save point. Break for lunch, come back to the code. What was I doing? What assumptions was I planning to depend on? I can look at the code and see that I'm assuming there are at least two numbers, in the list passed to SAFE, because I've written code to check that I've got two numbers.

[-]x0x7
0(+0|0)

Oh cool. That sdf-eu.org looks a lot like something I was trying to build years ago. I should join that.

[-]LarrySwinger
0(+0|0)

It's pretty well-known, surprised you only found out about it now. There's also https://tilde.club/ and https://ircnow.org/ although the original SDF remains the coolest.

[-]JasonCarswell
1(+1|0)

Easy like sudoku.

[-]x0x7
0(+0|0)

Probably easier than sudoku if you use AI. You should try it.

[-]x0x7
1(+1|0)

Pinging prior participants. AoC day 2 is here. @DV @happytoes

[-]Aurelius0(+0|0)

I wanted to try, but it was asking for too much info and I'm open enough as it is. Premise is very creative though

[-]x0x7
0(+0|0)

You mean like the signin? If you want I can start putting the puzzle content in my git. Then you don't even need to go to their website.

[-]Aurelius0(+0|0)

Right on. I mean, kinda kills the aesthetic, but whatever

[-]x0x7
0(+0|0)

In either case I added them.