#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

#### Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

# SUDOKU PUZZLE CODE!!!!

Posts: 1Member
HI! CAN SOMEONE PLEASE HELP ME WRITE THE CODE FOR THIS PROGRAM OR AT LEAST HELP ME WITH THE ALGORITHM.

PROGRAM DESCRIPTION:

Sudoku is a numerical puzzle. The puzzle consists of 9x9 squares arranged in a grid. This grid is further subdivided into 3x3 squares of size 3x3. Some numbers are initially placed on the grid. To solve the puzzle, a number between 1 and 9 (inclusive) must be selected for each square that is empty so that:

No number is duplicated in any row.
No number is duplicated in any column.
No number is in any of the 3x3 subgrids.
Write a program that allows a user to specify and solve a sudoku puzzle. Initially the 9x9 grid is empty, the user types in the numbers that are given for the puzzle. Thereafter, the user types in the numbers that he/she has computed to solve the puzzle at each stage.

Display the puzzle on the screen, with the entered numbers after each new number is entered. Note: The user can choose to enter a new number at any position he/she chooses, as long as there is no number there already.

After all squares have been filled with a number, check that the puzzle is a solution by making sure that the above constraints are satisfied. Note: there may be many, or perhaps no solutions to the puzzle.

· ·

## Comments

• Posts: 75Member
I have made my own Sudoku solver in Visual Basic. Ideally a Sudoku puzzle will only have one solution, that is how I made the solver. Are you looking to make your own solver or creator?

I think the best way to do a creator, is to start initially with a filled in grid and get the program to remove random cells one at a time, and after it takes away each cell it has to make absolutely sure that there is still only one solution to the puzzle. It's difficult to be certain of leaving it with one solution, but I'll have a good think about this.
· ·
• Posts: 2Member
I agree with faz that's likley yur best approach to this, or even better just go to a few of the online sudoku solvers out there [link=http://sudokusolver.info]sudoku solver [/link]is one however there's many. and just study the code it will open your eyes if your currently still stuck.
· ·
• Posts: 2Member
duplicate entry
· ·
Sign In or Register to comment.