BrowserUk,
Ah, I see. I am not entirely convinced smart brute forcing is entirely out of the question. The maximum number of iterations that you could possibly have to check is 186!. If you were dynamically generating your dials, the number goes way down.
dial 1 - any of the 186 indices (say 311)
dial 2 - any of the 186 indices that isn't dial 1's current (say 296)
dial 3 - any of the 186 indices that isn't dial 1 or 2's current (say
+257)
dial 4 - can't be anything because the sum of 1-3 is 864.
This is extremely messy to do in C though I have done it. Once you get to dial 7 you treat it as though it were dial 1 as far as sum goes. Doing it this way though cuts the possible paths down early and considerably assuming the data isn't designed for worst case.
I have no idea when I will have anything resembling free time again though so this is just an idea.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.