11-29-2012 10:40 AM - edited 11-29-2012 10:41 AM
I have trouble believing this code works. You have an obvious race condition. Use wires instead of your local variables. Plus, try using a FOR loop instead of the while loop and indexing. You can autoindex the incoming array.
Here's my refactoring of your code. So much cleaner.
11-29-2012 10:47 AM
Not good. Suppose you have a number combination that doesn't show up in your array. The while loop will run for ever.
Use the Search 1-D array like it has been suggested. Then if a number is not found, it returns a -1 as the index and you can handle that however you want to.