Reconcile Analog

Deve:
So, does anyone have any ideas on how to make THIS shorter and more streamlined? A solution that a novice programmer could understand and put inside existing code as a function (like below).

One problem is that if the user is smart enough to understand the function then they are smart enough to understand the "problem"

christop's function is a case in point. It is a neat improvement on mine using for loops, but by the time you have explained what either of them do you might just as well explain that the A* pins have numeric equivalents.