Closed AndrewRigg closed 7 years ago
This morning I altered the fitting procedure so that we wouldn't get dead first/last columns or rows, and so that we don't always necessarily fit the largest possible word first. It reminded me of something I saw years ago: one reason I was fitting the largest possible words first it because it gets good-looking and well connected crosswords, with lots of overlapping words. Fitting smaller words first can lead to more crosswords being disconnected (failing the HoshenhKopelman test) and often don't look as nice.
This won't be a problem when we change code for symmetry though.
However, I think you have changed the actual procedure, and not just the layout of my code. Your version is far less efficient than my original. For example, setting the size to 17, I checked how often I generate unconnected grids before an acceptable crossword is generated. For your code failed attempts were {118, 105, 127, 60,...}. In my version they were {2, 9, 1, 2, 1,...}, quite a huge difference.
Lesson: Don't make modifications to other peoples code before understanding the procedure Or, if you do, document them well.
I think the best thing to do may be for me to edit and experiment with my old version, then for you to re-incorporate the modified fitting classes back into your version. (I think this could end up being less hassle than for us trying to pinpoint the critical changes you made, but means you have to re-do the tidying and layout changes you already did).
Haha sorry bro. Just another example of my incompetence! Yeah was it due to doing the same method for both across and down? I sometimes forget that less code doesn't necessarily mean more efficient code! But hey this is the reason why I copied it all, I wanted to try mucking around with it and making it shorter/simpler. I did suspect that it got a bit slower at one point, but can't understand why it would be that much slower...
Has this one been done enough or do you need me to do the same for any other classes?
Add Steve's original comments back into the correct places for the algorithm classes. Try to make it look nice!