logoalt Hacker News

lionkorlast Tuesday at 1:33 PM2 repliesview on HN

I found the optimal solution for day 8 by hand, that was fun!

My algorithm, by hand, was as such:

1. Start with the smallest possible valid solution (1)

2. Expand slowly, and each "step" (like, moving a wall or two around to "obvious" spaces) must be a valid solution (this brings you to 40-60 score, depending on your choices, on day 8). Continue to step 3 once you can't see anything obvious.

3. Look at possible places where you could expand, but need 1 more block. You'll find one eventually.

4. See if you can spare any walls anywhere, using diagonals for example. If so, place the solution from 3 and go to 3 (repeat). If not, go to 5.

5. Count or estimate the squares gained by doing your improvement from 3. See if you can reduce your score by less than that, pessimizing your solution, to gain 1 wall. Once you've found one, go to 3.

That got me to the optimal score within 15 mins or so.


Replies

sambuccidlast Tuesday at 5:47 PM

This feels strangely similar to TDD with the Tranformation Priority Premise

ChrisbyMelast Tuesday at 4:54 PM

I found the same algorithm! The top down solution didn't really work.

Very fun game