LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sudoku

> It doesn't fully solve the puzzle, but it keeps track of the remaining possibilities in each cell.

That looks good.

> but if the puzzle is tough, the VI will still allow you to make most of the choices yourself. 

I haven't looked at the details of your solution, but it would be good to have a "go back" capability.  That is, have some buttons for "Save 1", "Recall 1", "Save 2", "Recall 2" ...  That way if you make a bad choice you don't have to start from scratch.

> I would only use it to help break a deadlock.

Yes -- helps keep the puzzle a puzzle.  My solver zips through and solves the puzzle in a matter of seconds -- the only challange was in writing the solver and seeing how quickly I could get it to solve.  There's no challange in the puzzle itself since the program does it all.  Your program does the tedious stuff while letting the user still have the challange.  Good work!

> It can still have a little trouble with changing your guess after a number has been entered, especially going from a number back to a blank, but it's almost there.  I also need to change the color scheme to make the grids more defined.

Some other solutions alternate the 3x3 blocks into yellow/grey.  It would be good if you can easily correct bad seeds.  That is "oops, I put the 3 in cell 6E instead of 7E.  How do I clear 6E?"

 

~~Les

 

0 Kudos
Message 11 of 41
(2,993 Views)

Les

>I haven't looked at the details of your solution, but it would be good to have a "go back" capability.  That is, have some buttons for "Save 1", "Recall 1", "Save 2", "Recall 2" ...  That way if you make a bad choice you don't have to start from scratch.

That's where the import/export feature will come in handy (If I have enough ambition to write it someday).

>Some other solutions alternate the 3x3 blocks into yellow/grey.  It would be good if you can easily correct bad seeds.  That is "oops, I put the 3 in cell 6E instead of 7E.  How do I clear 6E?"

If you click the "Seeded" button back to False, you can then put in the correct seed, then click back to True.  Undoing the incorrect seed usually works, but it's not foolproof.  It sometimes requires a bit of trickery (man vs. machine), but I'll see if I can nail that down better.

~~Mcsynth

0 Kudos
Message 12 of 41
(2,974 Views)
Les,

It seems as there are some major weak points in my code.  It will take a major re-write to fix, but I won't have time until after Christmas.  It only take a couple of wrong guesses to get hopelessly scrambled.

It all seems to do with the progressive nature of eliminating possible numbers from each square.  I think that each time a number is entered, I will need to re-calculate the entire block, row or column from scratch, rather than sucessively eliminating numbers based only on the current entry.

Thanks for the yellow/gray block color scheme suggestion.  It works much better.

Happy Holidays,
Mcsynth


0 Kudos
Message 13 of 41
(2,949 Views)

Les,

As promised, I worked on the Sudoku Helper over the holidays, and I think it's complete.  There is a Game folder and each game is given a timestamped folder to save game files.  You can also and reload intermediate values as you play.  It automatically saves the clues when you press the seed button and saves the solution when the puzzle is solved. 

I worked out the number logic to make it foolproof, as near as I can tell.  Please let me know what you think.

Happy New Year,

Mcsynth

Message 14 of 41
(2,914 Views)
Hey that is pretty cool.. I downloaded it and check it out.. only thing you could is a boolean to show or hide the hints..
 
 
Jeff D.

Certified Architect LabVIEW Champion DQMH Framework

0 Kudos
Message 15 of 41
(2,892 Views)

Compliments for the implementation and the programming style.

Albert

greetings from the Netherlands
Message 16 of 41
(2,871 Views)

Good Job. 

~~Les

0 Kudos
Message 17 of 41
(2,864 Views)

Hi

It is easy to get that functionality. Create a property node for "Remain" (this shows the numbers possible for that field).

next step crate a boolean, I always use the classic dialog checkbox withoutt showing the boolean text.

Place this boolean checkbox in a new event frame that handles the change value events of this boolean,
and connect the output of this boolean to the property node of Remain.
As an extra you could make Remain invisible at startup.

succes

greetings from the Netherlands
Message 18 of 41
(2,845 Views)


@Albert Geven wrote:

Hi

It is easy to get that functionality. Create a property node for "Remain" (this shows the numbers possible for that field).

next step crate a boolean, I always use the classic dialog checkbox withoutt showing the boolean text.

Place this boolean checkbox in a new event frame that handles the change value events of this boolean,
and connect the output of this boolean to the property node of Remain.
As an extra you could make Remain invisible at startup.

succes




YEp I added the Boolean to the version I downloaded.. it is very cool and well designed, Now I just need to try out some puzzles, although I hear that Sudoku is rather addicting
Jeff D.

Certified Architect LabVIEW Champion DQMH Framework

0 Kudos
Message 19 of 41
(2,828 Views)
> Now I just need to try out some puzzles, although I hear that Sudoku is rather addicting
 
It is, until you write a program that solves them in seconds.  😞
What's interresting is the difference between puzzles that the book says are difficult, and the ones that my program has to take multiple guesses on.
 
~~Les Hammer
0 Kudos
Message 20 of 41
(2,813 Views)