I assume that he figured as much as that he had to randomly rotate the tiles. I think there is more of a problem to:
- Generate the maze in the first place
- Make sure there are no empty tiles
- Make sure that all tiles will have to be used (no sections not connected to the rest of the network)
- No dead ends
- Same number of bulbs for each generated puzzle (or at least about the same)
- Only one solution exists (not sure if this is NEEDED, but probably the way it should be.
- No loops
The code for jnetwalk was published, so hints could be in there, but it was a 4k game so he did some cheating I think.
Have not thought much about it, but I think you could create a big room and then split with a horizontal and a vertical line/wall at random places. Add 3 doors at random places on 3 different subsections of the walls. That way you can get to everywhere from everywhere. Then recursively subdivide the 4 new rooms the same way until it isn't possible to subdivide anymore. Then you should have a maze with no loops and everything connected. You are looking for a network, so replace every path with a line and remove the walls. Just place the hub at a random place and a "bulb" at every dead end. Think that should solve most of the problems. Not sure if this would only give one solution, and number of bulbs could vary, so there might be a better way to do it, but it seems like a fairly easy way to create it. I have not tried to implement anything like this, just seemed like a fun challenge to figure out. Hope I didn't overlook any problems with it.