Jump to content

grid[n*(i-1)+[j][k] := (x mod n^2) + 1;


Pollux

Recommended Posts

Hello,

I'm at my job and is boring today, so I'm trying to implement the basic sudoku-generating algorithm that I found here, hoping that in the near future I will build a sudoku-solving algorithm in LabView.

I don't know how could I implement in LabView the line in the title.

post-10966-1218008154.jpg?width=400

Can anyone help? :worship:

Link to comment

QUOTE (Pollux @ Aug 6 2008, 03:39 AM)

Hello,

I'm at my job and is boring today, so I'm trying to implement the basic sudoku-generating algorithm that I found here, hoping that in the near future I will build a sudoku-solving algorithm in LabView.

I don't know how could I implement in LabView the line in the title.

post-10966-1218008154.jpg?width=400

Can anyone help? :worship:

There is something called a "Formaula Node" under "Programming->structure->FormaulaNode".u can use this implement the logic.

U can directly

QUOTE (Pollux @ Aug 6 2008, 03:39 AM)

, hoping that in the near future I will build a sudoku-solving algorithm in LabView.

I don't know how could I implement in LabView the line in the title.

post-10966-1218008154.jpg?width=400

Can anyone help? :worship:

There is something called a "Formula Node" under "Programming->structure->FormulaNode".u can use this implement the logic.

U can directly use it....

Link to comment

QUOTE (Neville D @ Aug 6 2008, 07:20 PM)

Reading and writing to arrays as local variable copies will affect performance, readability and introduce race condition bugs.

Use shift registers or stretch the wires out..

Neville.

Thank you for the advice.

Actualy I use this type of assignement in bigger projects. :oops:

This type of assignement is this to be avoided only for the arrays, or is the same thing for scalar type variables?

That's way I like small examples like this. I get all kind of tips.

Link to comment

QUOTE (Pollux @ Aug 6 2008, 11:57 AM)

This type of assignement is this to be avoided only for the arrays, or is the same thing for scalar type variables?

That's way I like small examples like this. I get all kind of tips.

Using it for Arrays will affect performance, since every local variable of an array will make a separate copy of the array. Also, reading and writing locals switches to the user interface thread.

Scalar variables might still cause race conditions when a write might accidentally trample a read operation.

Overall: use wires where you can. Its easier to read, will give best performance, and not cause race conditions.

Locals are OK, if for example you are reading vals from an ini file and initializing a bunch of controls on the front panel once. If doing anything in a loop, avoid them.

Also don't try to get around that by reading or writing to the "value" property of a control or indicator. That is even slower than using locals. Again a "one off" use is fine.

Neville.

Neville.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.