Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Reminds me of the puzzles for an iOS game I put out a couple of years ago: Little Broken Robots. In that game you had numbers but could “walk” out from a number that many spaces. You had to fill in all the empty spaces.

My strategy for generating puzzles was island based. I had a board checker that would scan through the grid and place all empty spaces that could be reached contiguously into a single “island.” I would then pick a random island (the first island was always the full grid), pick a random tile in the island, pick a random number with a max value of either the puzzle’s max (up to 8), and then drunk walk outward. In the event the drunk walk got “stuck” it would just pick a different starting tile within that island.

Recompute islands and repeat until there are no spaces left. Island with only 1 square are “dead” and just get filled in with blocker tiles.

Each puzzle had many solutions, but because there was always a “right” pregenerated solution we could give hints based on the canonical solution.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: