a C# learning space
|
Buy me a cup of coffee?
|
Coding Sudoku Sharp
There are thousands of lines of code in the Sudoku Sharp application. So, I'm not sure how much of it I'm going to include here. In many cases I'll
give you the code to get things started and then it's up to you to fill in the blanks. Hopefully, I will not leave you floundering to figure out where
to go next. If I do, I sincerely appologize up front.
We'll begin with the menu and the toolbar menu and then get into all of the board and how it looks and feels to the end user. I wanted to make the game
as customizable as possible. So, I've added an Options menu item where the end user can choose the colors they prefer.
And of course we need a way to actually play Sudoku. We need a way to create puzzles and if necessary, a way to solve them. The method I use to create
puzzles is to randomize the numbers I start with and then fill in the rest of the puzzle and then start removing numbers randomly and try solving the puzzle
and then rinse and repeat until the puzzle cannot be solved. This method can make some pretty chalenging puzzles, depending on how you choose to solve them.
I like to try solving puzzles without showing what the candidates are. It makes it a bit more challenging to find naked singles this way rather than seeing
that there is only one candidate available in a cell.
Get started with
Menus & Toolbars and then progress through each tab in the sub menu.