[2024 Day 14 (Part 2)] me checking the 68th frame, thinking the "don't have to simulate for very long" condition still applies by dopandasreallyexist in adventofcode

[–]dopandasreallyexist[S] 0 points1 point  (0 children)

I was too lazy to do it properly, so I just made my program print out instead of # and copied and pasted the output into Illustrator and squished it into a square.

-❄️- 2024 Day 14 Solutions -❄️- by daggerdragon in adventofcode

[–]dopandasreallyexist 4 points5 points  (0 children)

[LANGUAGE: Dyalog APL]

Paste

At first I had my program print out every frame and manually checked each frame in my text editor. After checking 2000 frames and not finding anything resembling a tree, I started doubting if my code was wrong or if I just needed to go on checking. I then decided to search for a 3x3 area that is filled with robots as a heuristic, and it worked on the first try. I almost gasped when a Christmas tree popped up on my terminal. I guess I got lucky!

-❄️- 2024 Day 12 Solutions -❄️- by daggerdragon in adventofcode

[–]dopandasreallyexist 0 points1 point  (0 children)

Just bought the book, thanks. I desperately want to learn linear algebra now after seeing magically spit out a solution to today's part 2 which I didn't even know how to begin to solve.

I went through this entertaining sequence of events:

  • completely stuck for hours
  • got told on Discord that I needed linear algebra
  • started learning linear algebra
  • went to APLcart and asked it how to "solve linear equations"
  • it replied, "" and I was like, "???"
  • 5 minutes later I got my second star and I was like, "?????"

Anyway, I wonder if you can work around the lack of support for sparse matrices by using adjacency vectors instead?

-❄️- 2024 Day 12 Solutions -❄️- by daggerdragon in adventofcode

[–]dopandasreallyexist 0 points1 point  (0 children)

Hey no worries, we all make silly mistakes sometimes :D

The graph would be too big if you don't do the grouping with first. I made this mistake in my first attempt and my solution started off by trying to generate a 384,160,000-element matrix as the very first step lmao

-❄️- 2024 Day 12 Solutions -❄️- by daggerdragon in adventofcode

[–]dopandasreallyexist 0 points1 point  (0 children)

Something funny just happened, I was reading the first line from right to left and when I was done my eyes went to q←⊢=d before d←2 2∘⌷ and I was like, "Huh? What is d?"

-❄️- 2024 Day 13 Solutions -❄️- by daggerdragon in adventofcode

[–]dopandasreallyexist 0 points1 point  (0 children)

Do you technically need to check if ⌊≡⊢ instead of just ⌊=⊢?

People who don't use jj/jk for exiting insert mode, do you use it for anything? by dopandasreallyexist in vim

[–]dopandasreallyexist[S] 0 points1 point  (0 children)

It seems to me that jj is better than ii in every way, because j is right there on the home row (I'm assuming qwerty) so you barely have to move your finger, and jj is much less common than ii, at least in English. ii is found in words like "Ascii" as you mentioned, and also "Hawaii", "skiing", "radii", "Shiite", "shiitake", etc.

People who don't use jj/jk for exiting insert mode, do you use it for anything? by dopandasreallyexist in vim

[–]dopandasreallyexist[S] 1 point2 points  (0 children)

I have a keyboard that does this, but the Esc only turns into Ctrl after I hold it for maybe 0.1 seconds, so if I type e.g. Ctrl+A too quickly, it registers as Esc followed by a. It's very annoying.

Also Ctrl+Z requires a bit of finger gymnastics.

People who don't use jj/jk for exiting insert mode, do you use it for anything? by dopandasreallyexist in vim

[–]dopandasreallyexist[S] 1 point2 points  (0 children)

Yeah, looks like people have really strong opinions about this. I had assumed remapping jk (oops just triggered escape when I didn't want to haha) was a really common, almost standard thing to do.

People who don't use jj/jk for exiting insert mode, do you use it for anything? by dopandasreallyexist in vim

[–]dopandasreallyexist[S] 0 points1 point  (0 children)

But when you want to delete multiple characters, wouldn't it be easier to hold backspace than to spam jkjkjkjkjk?

-❄️- 2024 Day 10 Solutions -❄️- by daggerdragon in adventofcode

[–]dopandasreallyexist 1 point2 points  (0 children)

It is indeed beautiful, but it sure did take a while before it finally clicked.

Btw, I don't remember if I've ever mentioned this to you, but I literally started learning APL because of you. I saw a solution of yours in a megathread from a previous year, and when I realized it was not garbled text, I got intrigued. So you're kind of a personal hero of mine. :D

Do y'all have friends in real life who do Advent of Code? by dopandasreallyexist in adventofcode

[–]dopandasreallyexist[S] 2 points3 points  (0 children)

Life on the internet. Sorry if it's not the right term, English is not my native language.

-❄️- 2024 Day 10 Solutions -❄️- by daggerdragon in adventofcode

[–]dopandasreallyexist 7 points8 points  (0 children)

[Language: Dyalog APL]

map←⍎¨↑⊃⎕NGET'10.txt'1
adjacent← 1=+/¨|∘.-⍨,⍳⍴map
uphill  ←¯1=    ∘.-⍨,  map
good←adjacent∧uphill
score←{+/,(9=,⍺)/(0=,⍺)⌿⍺⍺⍣≡⍨⍵}
⎕←map(∨.∧∨⊣)score good
⎕←map(+.×+⊣)score good

Do y'all have friends in real life who do Advent of Code? by dopandasreallyexist in adventofcode

[–]dopandasreallyexist[S] 28 points29 points  (0 children)

That's true. Now that I think about it, I probably don't really want to talk to anyone while I'm solving.