What are you coding?

Roger pointed it out. I despise alt-tabbing and this is such a huge mental boost. Honestly, more of a mental boost than it should be.

2 Likes

One of the languages I use for The Weekly Challenge is Lua, which has 1-based indexing. Often that’s fine. Sometimes it’s a Complete Pain.

And it doesn’t interact with your code at all, just downloads puzzle and input where you tell it to. So while it’s in Rust and I’m writing Rust this year, it’s language-agnostic.

2 Likes

I use awk quite often and, while not officially any specific-based indexing, 1-based indexing is often most useful.

I should use awk less. It’s because of sed/awk/grep that I have less to show for my time spent (but more in my ~/.bash_history)

2 Likes

ah the input download and examples I made for myself in Java also removes a ton of manual steps.

2 Likes

I should auto-process puzzle.md into candidate examples. [fixed after phone’s interesting spelling decisions.]

2 Likes

Part 1 today (Day11) is easy. And then comes part 2. I have ideas how that one is going to be solved. Short-cuts will be necessary. I just don’t quite see how yet. Optimization day.

When testing a list of just 0 for 30 blinks, I am getting a total size of 256.000 or so. But it is just 54 different numbers. Something something cycle detection. I am reasonably sure if I can figure it out for 0s… I can solve it.

1 Like

AoC Day 11

Part 1, easy peasy. I actually had a OO-approach I really liked with a deque() queue for iterating the stones.

Part 2 would have been done an 2 hours sooner if I had remembered the correct functools caching mechanism.

1 Like

AoC day 11

It’s Lanternfish (2021 day 6) all over again! With added misdirection. The order is utterly unimportant, so instead of storing the row, you just store a hash of values and counts.

2 Likes

AoC day 11: a total stranger on Mastodon says: “Darn, that’s much more efficient than my solution (and all other solutions I’ve looked at so far)”. I preen. :slight_smile:

Everybody Codes day 15: I had to put this on hold last Thursday evening after part 1, and didn’t get back to looking at it till today. What a pain! I did Dijkstra and then permutation-based TSP, and cheated on part 3 by segmenting the graph—as I think everyone had to.

2 Likes

Day 11:
Part 1: easy.
Part 2: Thanks for the cache clue
I am so glad I saw that, it saved me hours of dev-time (so now I can watch more Apothecary Diaries). As such I was actually able to get it done in decent dev-time and awesome run-time :slight_smile: My 75 blinks run in just 92ms for the input. I didn’t expect that, I didn’t do all that much to speed up, except… I did?

“new” is expensive in java. I got rid of a lot of “new” object creation.

2 Likes

AoC Day 11

continued discussion

I’m really shocked how much caching impacted this particular puzzle.

Even with slow crap like val, ch = int(val), str(val) so that I can have the benefit of treating the value as both a string and an int in my cached function, 75 iterations with caching is faster (almost twice as fast!) than 25 iterations without (even using cached functions to speed up the digit splitting)

2 Likes

AoC day 12

details

This was the first day for which part 1 seemed like more than trivial work. I came up with an edge scanner that worked for perimeter length, then modified that for part 2 to store its results by attempted direction and dug down into that. Rather fun, thought I might coalesce ranges but in the end just looked for gaps.

2 Likes

AoC Day 12

I thought I saw Part 2 coming, so I approached Part 1 differently than I normally would.

But now I’m sat here grumbling at the actual Part 2. Because I used merging regions, I’m just going to extend the same logic and merge perimeters.

But I wish I had done a perimeter walk instead

1 Like

Everybody Codes day 16

Getting quite tough now. Parts 2 and 3 went off in quite different directions

I didn’t see part 2 coming for Day 12 so part 1 was allocating Regions with a wild mix of stacks and sets and neighbors (pathy stuff) and then i just counted all the 4-neighbors.size() for the perimeter. Was no help at all for part 2.

Part 2 I tried various things like counting corners… yeah… no.
Until I went back to what I call the “logical brute force” and actually calculating all the edges and counting them. No shortcuts… that I could think of.

edit: Just saw on mastodon that I did have half the solution if only I had remembered that the stuff I was looking for is called polyogons and vertices in math speak and I might have successfully googled the “formula” which I have previously implemented I am sure.

1 Like

I am scrolling memes for a bit and yesterday was definitely a good day

Also lovely but only for Dr Who fans:

browsing r/adventofcode is one of the best parts of AdventOfCode (even though otherwise I have mostly given up on reddit)

3 Likes
I'm quite happy with my day 12 approach to finding regions:

have a list of all valid coordinates
make a Set copy of that, “starts”
pick an entry at random as a starting point
explore to find all connected nodes with matching letter
do whatever calculations I need on the region
delete every point in that region from “starts”
repeat until “starts” is empty

2 Likes

You might be on the right track when you type in “python solve” into a search engine and the algorithms show you exactly what you’re looking at because a bunch of other people probably are already Googling it.

2 Likes

AoC Day 13

Part 1: I feel clever. I had 3 classes just about built when I realized it’s really just a nested for-loop to figure out a and b counts and their costs
Part 2: I feel dirty. I used sympy

AoC day 13

This isn’t a computing problem, it’s a mathematics problem. Two equations, two variables, means there can only be one solution. Then you just check that the solution values are integers.

1 Like