LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sudoku

jdebuhr
 
That was a great suggestion about being able to hide the clues.  That way you can only use the clues when you really feel stuck.  It only took a couple of minutes to implemented, and it puts some of the challange back into the game.

Thanks,

McSynth

Message 21 of 41
(4,035 Views)
No problem, Like I said it is a cool program you have there. I am going to build into an app and install it on my Fathers PC, he does those puzzles and this way if he really gets stuck, he can try out the helper.

@mcsynth wrote:
jdebuhr
 
That was a great suggestion about being able to hide the clues.  That way you can only use the clues when you really feel stuck.  It only took a couple of minutes to implemented, and it puts some of the challange back into the game.

Thanks,

McSynth




Jeff D.

Certified Architect LabVIEW Champion DQMH Framework

0 Kudos
Message 22 of 41
(4,031 Views)

hi

i am vahid khaki from iran

this is my sudoku game and solver

you can download it and enjoy from it...

Download All
Message 23 of 41
(3,323 Views)

Hi Vahid!

 

Thanks! The front panel is very pretty and the code seems to work. Excellent! 🙂

 

Personally, I don't like the coding style: Way to many local variables and stacked sequences and way too much duplicate code (For example the inner stacked sequence with 9 frames has 9 identical frames operating on 9 explicit subsets. All this could be done in a FOR loop using one (instead of 9) instances of the same code. If you have time, try to polish the code a little bit. It should also fit on a single screen. Many of your while loop have a fixed number of iterations, thus they should be replaced by FOR loops. 😄

0 Kudos
Message 24 of 41
(3,297 Views)

i am vahid

yes that is right

my program in block diagram is very amatur i will improve it and then i will send that for you...

i work whit labview for one month and i am very amature

0 Kudos
Message 25 of 41
(3,261 Views)

hi i am vahid this is my new sudoku :

 

Download All
0 Kudos
Message 26 of 41
(3,212 Views)

Thanks. Now you added a few more diagram comments for explanation.

 

This is exceptional code for a beginner LabVIEW programmer. Now you need to try to use some more advanced programming techniques to simplify and streamline the existing code. You seem to learn fast, so that should be fun. 🙂

 

Overall, the code is still 10x more complicated that it should be. For example, to see if a position is won, you do exceedingly complex sequences. Why do you represent the board sometimes as strings and sometimes as a numeric array? I would do all computations on the numeric and convert to/from a strings just for the UI (include range checking and validation). The board could even be an Xcontrol doing the conversion and validation and the main VI could be entirely numeric.

 

As a very simple example, here's some compact code that checks if a board is won. As you can see, you don't need to extract all sub arrays and then sequentially process them. You can do the extraction and processing at the same time, re-using the same code and reducing the amount of data in memory. Most of your while loops should be FOR loops, you can still terminate early using the conditional terminal, but you no longer need to check [i] at each iteration.

 

Your program is still way too sequential. You should try to embrace dataflow.

 

You can probably eliminate a lot of of case structures if you would make seperate event cases for each button.

I would probably place the solver code inside the event structure.

 

You should keep the board representations in shift registers and eliminate all local variables. It would make the code much more efficient and easier to edit and debug. Similarly, all hidden/invisible controls that only serve as locals should be eliminated. Normally there is no need to involve the front panel into computations unless it displays useful information for the user.

Message 27 of 41
(3,194 Views)

hi i am vahid

i download your code ( win code)

wowwwwww.......... your cod was veryyyyyyyyyyy interesting....that is right...our code is not proffesional...

i hope you send me your E mail ... i need your help .... i like labview very much but i don't have any one that be able too help me...

if you have any code that is usfull for me please send it for me...my E mail : VahidKhaki63@yahoo.com

many years ago i work whit Matlab ( i do not like write code) , but in labview we can do every thing..Smiley Happy

0 Kudos
Message 28 of 41
(3,147 Views)

Well, I wrote "millions" of programs, and most are probably not of interest to most. 😄

 

If you are looking for a game example, I just spend a few minutes polishing up my old 4x4 Tic-Tac-Toe. (no code change, just some cosmetics and code cleanup). It is now in LabVIEW 2009.

 

There is little documentation, though.

 

 

 

 

 

Download All
Message 29 of 41
(3,114 Views)

heys there..im new to this forum here and am learning this software to use it in my final year project..anyone of u guys have heard of  PCR Mobile Lab User Interface in LabVIEW?..pls do reply me..thanks and sorry for the bothering 😃

0 Kudos
Message 30 of 41
(3,094 Views)