I want to take a string of the form "(ABC)(DEF)" and translate adjacent pairs of letters into numbers, interpreting the letters inside parenthesis as cycles. From my example I would want to generate the table:
{{"AB", 1}, {"BC", 2}, {"CA", 3}, {"DE", 4}, {"EF", 5}, {"FD", 6}}
I could do this with a loop, but my limited knowledge of the 'Mathematica Style' of coding suggests that there is a better way to do this in Mathematica. How do I do this the Mathematica way? In general where can I learn about Mathematica style coding?
Edit: Changed my mind. I want to create a function, f, such that f["AB"] = 1, etc. but I don't think this will change the problem much.