Results 1 to 5 of 5

Thread: Code this better...

  1. #1

    Thread Starter
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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.

  2. #2

    Thread Starter
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    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.


  3. #3
    Member
    Join Date
    Apr 2004
    Location
    Canada
    Posts
    55
    uh... where is the form?? it not included

  4. #4

    Thread Starter
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    sorry about that. here it is. I've added it to the project.



    haven't done anything to it, though. sorry again.

  5. #5

    Thread Starter
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    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
  •  



Click Here to Expand Forum to Full Width