We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sudoku Solver Published No.:XZXJ94.000
#1
Hello, I am 'The Old Guy'.  I am not new to Small Basic and I am definitely not a guru.
I have a liking for Sudoku and was searching the net for a listing in Small basic to solve Sudoku using a backtracking algorithm.
Having not found one I decided to compile my own. 
I am aware there are a lot of solvers available to not require another adaptation to get the job done but once my curiosity was
aroused the bee in my bonnet would let me put it down.
If the members of this forum are also curious enough to take an interest, I would be happy to take comment or criticism.
Thank you.
Reply
#2
(translated by Google translator)

Hello, "Old Guy".  Shy

I don't know the game "Sudoku" at all, but I am interested in exploring the possibility of using our proprietary SB neural network for this game.
So, I will try to take part in the discussion of the topic "Creating a solver for the game Sudoku" that you started.

Blush
Reply
#3
I've also not seen a working Soduku solver in SB.

I don't know what you have so far, but I guess the first part is to program the rules so that any grid can be tested and inconsistencies found.

Then code so that each blank square can find its possible values and go from there.

Also some way to get a starting grid in easily would be good, like a simple file format to read.

As you go I'm sure the community will chip in with ideas...
Reply
#4
The file searcher found in my SM library 34 files  with the word sudoku in it.
Most of the small files are testprograms to draw a grid and help you with the test for possible solutions

There are five files with more than 1000 lines, possible to "automatic" solving
The are all available in the old published programs, I have not tested them at the moment.

The five files are:
FDB098    1498 lines
JJT479    1404 lines
NTS300-0  1067 lines (Nonki Takahasi)
SWT064    1519 lines
ZDX706    1421 lines

Perhaps you can look for use of (part of) these old programs.

If you are interested I can give the codenumbers of more files
[-] The following 3 users Like WhTurner's post:
  • AbsoluteBeginner, litdev, stevantosic
Reply
#5
Yes, I didn't check through this list - the Nonki one I expect to be good, and it is.
Reply
#6
Thank you for responding to my post

I have viewed all of the listings you have recommended but
they are very different to my program which is a complete
and ready to used program.
The program is a Sudoku Solver which allows any published
9x9 unique Sudoku Puzzles to be cloned and then solved.
The listing I submitted for review is XZXJ94.000

I am not a novice or guru. Just an amateur who delights in coding using Small Basic

I am 79 years of age which gave me to choose my username.
[-] The following 4 users Like The Old Guy's post:
  • AbsoluteBeginner, Scout, stevantosic, z-s
Reply
#7
Hi,

I tested it using Nonki's program (NTS300-0) for a start grid - it froze so maybe Nonki's grid is impossible in some way or there is some infinite loop or some other issue in your program.

I haven't attempted to debug it as this may be fun for you - a quick look at your code shows it is nicely structured with event loop, subroutines, comments and useful variable names so that is all good Smile .

It may be good to somehow link the two programs to provide a test environment?

   

EDIT

While I was writing this it completed  Big Grin (a few mins after starting), so perhaps some indication of progress would help.

   
Reply
#8
Thank you for your suggestion, It appears sound. I will take this on board.
Reply


Forum Jump:


Users browsing this thread: