Yes, towards the end of the generation each number is tested for uniqueness within its horizontal and vertical lines as well as its sector.
What makes a board a "good" one is of course the quantity and placement of the initially displayed numbers. My code does not address that aspect. It only dabbles in randomly generating the full board so that players aren't subjected to the same pre-generated ones over and over.
So, it only generates fully solved boards? That's a pity. Picking the initial numbers is the tricky part. I don't think there are many opensource libraries for that.
4 comments
[ 2.8 ms ] story [ 21.7 ms ] threadWhat makes a board a "good" one is of course the quantity and placement of the initially displayed numbers. My code does not address that aspect. It only dabbles in randomly generating the full board so that players aren't subjected to the same pre-generated ones over and over.