Limbic~Region, I work with
gr0k and he has to leave for the day, so I'll reply back. I think our example of what we want was fine, but maybe our code confused some people (as you state in your replies). What we are trying to get it is basicly this...
We have...
A=10
B=1
C=6
to be checked. We want to only add up the combinations that are unique. So, what we were ultimately trying to do was generate a list that would give us a way to calculate the unique combinations. Something like this...
A
A B
A B C
A C
B
B C
C
So we'd then run through that list applying our values...
A - 10
A+B - 11
A+B+C - 17
A + C - 16 * matches 16 no need to check C+A, etc..
B - 1
B+C - 7
C - 6
So A+C matches what we want. No need to check C+A. Same with if A+B+C matched what we want. No need to check A+C+B, B+C+A, etc... That was our ultimate goal. Of course A B C could easily be 100 long or even more, but left it small for this post. Hopefully that'll clear some things up. Thanks for all help.
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.