avatar
Owen O’Malley @owenomalley.bsky.social

It all should be translatable to C++. I basically created a small (max 4 items) stack for each place in the grid. When I move to a new square, I push my previous position to new location's stack. That lets me unwind my path and detect loops. The code iterates backwards and puts a block on the spot.

dec 13, 2024, 9:44 pm • 0 0

Replies

avatar
Owen O’Malley @owenomalley.bsky.social

That means I don't need to redo the previous stuff, because I start right at the new block. I then pop off the path back to the block and do the previous location.

dec 13, 2024, 9:44 pm • 1 0 • view
avatar
int2str 🇺🇦 @int2str.net

Thank you for making me look back at that day. Found a silly bug and went from ~400ms to ~80ms on my fast machine and a whopping 1.6s down to ~350ms on my slow-poke test machine. Had a silly mistake in my loop detection code. Now Day 7 is the hold-up for me....

dec 13, 2024, 10:28 pm • 1 0 • view