|
-
Aug 16th, 2004, 10:45 PM
#1
Code this better...
This program was developed as a brute-force method of a previous post (by me) that nobody seemed to care to try.
http://www.vbforums.com/showthread.php?s=&threadid=300549
I need 2 things.
1) try to make it more efficient
2) find a way to make sure that a(0) thru a(9) has a different value for each array value. (Make sure that it uses 0-9) with NO duplicates
Then, it will be correct. I used a break statement to make sure that it would calculate the right answer, but it took too long!
Here is my code.
Enjoy!
Last edited by dglienna; Aug 17th, 2004 at 06:31 PM.
-
Aug 17th, 2004, 10:31 PM
#2
I have concluded that it would not be of any use to waste cycles filling in a array of value-flags, except in some circumstances, like when it would save thousands of cycles. Plus, I don't know if all values are used in numbers that don't add up?
I do know that there is only one answer that computes, and also uses all of the digits. [I have checked them all]
Plus, I didn't compile it, so that I could use the break key.
Maybe I will try to see if the first 4 arrays are unique, and if so, then skip the inner loops. This would save a bunch of cycles, but I'm not sure of the most efficient AND fast way to do it is.
I will post the new code when I have it finished, so that it will stop at the correct number. Then I can compile it and time its operation as I make changes.
I wasn't sure how to go about solving the problem programmatically, and it feels good having accurate results.
-
Aug 31st, 2004, 06:23 AM
#3
Member
uh... where is the form?? it not included
-
Aug 31st, 2004, 08:58 PM
#4
sorry about that. here it is. I've added it to the project.
haven't done anything to it, though. sorry again.
-
Aug 31st, 2004, 09:01 PM
#5
this was also discussed in detail in math forum.
Here...
It has become so common that it was hardly worth it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|