HELP Me for my project solver sudoku

Hello guys, I'm a student in a vocational baccalaureate program in computer science and I'm French. We have a final project to complete, which is to create a Sudoku solver application. We've created 81 text boxes and a "clear all" button, but we want to add a "solve" button to solve the entire Sudoku puzzle that will be entered. However, we don't know how to do this. Can you help us? Thank you!

Suggest a

search

1 Like

Do you want a total cheat solution, or would you settle for an undo stack assist for a human solver?

Here are some sample designs for rectangular number selection games:

It's important to separate the display part of the app from the internal board representation.
What's nice to look at is usually awkward to process during game play.

Your life will be easier if you use generic (Any) blocks and lists of components.
Sample:

I've used some JavaScript code to implement sudoku solution.

Google knows lots of solver techniques ...

https://www.google.com/search?q=sudoku+solver+algorithms

Reading the collection of articles on solution algorithms returned by my Google search, I would bet that watching an app attempt a trial and error solution would be entertaining.

I have some ideas for internal representation of a Sudoku board and a solution stack that could support trial and error, if you are interested.

A 81 character string of digits 0-9 is simple to manipulate using text segment and split blocks, along with the index in string block for empty cell searches.

A list of solution attempt steps could have columns

  • Beginning board string
  • Index (1-81) of attempt cell
  • Cell value attempt (1-9)
  • Ending board string (redundant)

You would need a low water index constant to avoid backtracking over the initial problem cells.

As each row is added to the stack, check if it's legal, otherwise try the next ascending cell value.

If no values work for a cell, remove the last row from the stack and try the next ascending value for the last row.

1 Like