first of all this is my first time asking something here so please let me know if I am doing something wrong or asking it on the wrong place.
I have a custom puzzle model where I need to generate different puzzles difficulties, but I am having some problems making sure that the method that I use ensures that there is only one possible solution to solve it.
The puzzle is actually pretty simple, it consists in a board that can have any given size, but lets only consider a 4x4 so its easier to explain, the goal of the puzzle its to fill the entire board using only 'X' or 'O', and we can only have 2 symbols of the same type together in any direction, in other words you can´t have 3 or more equal symbols in the vertical, horizontal or diagonal, and there is also some locked squares, where you can´t play, they work as the ones in crosswoards.
Example of a well solved puzzle:
The puzzles are suposed to be generated with some clues and with all the blocked squares, and they are suposed to be generated with one of two difficulties, easy and hard. A easy puzzle can be solved only using logic, similar to a easy sudoku, wich means if you keep "blocking the sequences of two" you will end up solving the puzzle completly, meanwhile the hard ones they require more thinking, you need to make guesses to be able to solve them.
Examples of puzzles with different difficulties:
At this point I can generate the two difficulties, the method that I use to generate the easy ones pretty much consist, after filling a board in a random way, recursively remove the 3rd element of the sequence, in other words the one that is diffrent, if I keep doing that untill its not possible anymore, I will end up with a puzzle that only has one way to be solved I believe, doing the same process, but backwards, even if you do it in a differente order there should only be one way to complete the board.
The problem starts when I try to generate the hard puzzles, I will now the explain the method that I use:
-Due to the fact that a given point a hard puzzle becomes a easy puzzle, I start for execuing the algorithm that generates the easy puzzle.
-Now that I have a board with a puzzle thats easy, I will try to remove some of the clues, so to test if I can remove it, what I do is to try to solve the puzzle with the opposite symbol on that position, if its not possible to solve it with the different symbol, that means I can remove that clue, because, that means that I will always need to have the same symbol in that postion, so I will always end up with the easy puzzle where I started. Once again I keep doing this same thinking for all the clues.
At this moment this seems to work very well, and at first sight the puzzles created seem to have actually a unique solution, but I am not entirely sure, so can anyone please help me to make sure if this works?
Thanks for the attention.