LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

permutations of a 6! numerically

Solved!
Go to solution

Hi John,

 

look for the "Application Control" functions palette. "Open VI Reference" and "Call by Reference" might be interesting...

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 31 of 57
(1,176 Views)

Can recursion be used for this challenge wiht LV 8.2?

 

Somewhere in there we picked-up the option to share clones but without that option, it may blow-up in LV 8.2 due to a lack of memory.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 32 of 57
(1,154 Views)

What would be wrong with just using a while loop that counts to 1000000. Convert each iteration to a string, filter out any number with [0,7-9], then do a simple search and replace (1=A, 2=B, etc).

 

Of course, it gives you repeat letters and lengths shorter than 6, but those should be easily filtered as well.

 

Not elegant or super fast (takes a few seconds to build it to an array, didn't try writing directly to a file), but certainly easy.

Message 33 of 57
(1,136 Views)

Its simple, and the filtering would be straight forward,

its not elegant but that would work.

 

hmm, nice idea. And it would be easy to see if it worked, run a line count compare to n! for that number and check for repeats and remove.

 

That might just do it.

 

I'll give it a go! 😄

0 Kudos
Message 34 of 57
(1,124 Views)

Here's a quick modification (LabVIEW 8.0), adapted from this much more complex problem. 😉

 

 


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Download All
Message 35 of 57
(1,118 Views)

... and here is the same using plain strings:

 


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Download All
Message 36 of 57
(1,102 Views)

sweet, here's hoping it'll run on LV v8.2 😄

0 Kudos
Message 37 of 57
(1,097 Views)

Sorry, down-conversion to 8.0 will get rid of the in-place structure, so the attached 8.0 VI is a bit ugly. To simplify, you can remove the inner while loop without breaking anything.

 

Here's the string version as a 2009 VI for those who upgraded.

 


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 38 of 57
(1,091 Views)
Solution
Accepted by John Pierson

 

Here is a cleaned up 8.0 version:

 

 

of course you need to be careful. Don't use very long strings or it will break because of datatype limitations. 😉


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Download All
Message 39 of 57
(1,084 Views)

yup, that does the job perfectly, can even be expanded for 7, 8 etc... itterations.

does waht i needed and more 😄

 

now to write to a notpad file 😄

0 Kudos
Message 40 of 57
(1,079 Views)