I started reading your code, but it feels longer than it should be, and these loops get pretty dirty. Nothing jumps at me immediately. You said that you do not just want solutions, but also tips.
You should find out if there is a problem with your design (it does not work for Sudoku solution), or if there is just an error in the implementation. Perhaps read and write comments on what each loop does, the “rubber duck test”, as a result of which you are forced to explain everything, you will stop yourself and realize that something is not needed, or it is not what it should be. This helps with design issues.
If the problem is implementation, do you know how to formally debug an application? Set breakpoints and go through the instructions according to the instructions? If you have a small mistake, but you don’t see where to go. Find a really simple example that fails, then run this test and break it at the beginning. Step by step and follow the logic. I hope you see where this is happening. Writing JUnit tests or log statements is great, but when you have a tricky error, you have to make a real debug breakpoint.
Your general structure is good, you have some objects for storing data and a good cleaning method that calls several different methods and passes through them. But each of these methods, wow, they are sure that they are dirty. This type of code, many hard loops using the same variable names, a lot of manipulation with arrays, breaks something so easily and gets an error, and this makes reading and detecting errors difficult.
Eclipse makes it easy to debug java if you haven’t done this before. A lot of good tutorials on google, so I won’t worry ^ _ ~
source share