in reply to Re: Re: Brace For This
in thread Brace For This


At the risk of being pedantic, not exactly

You are right. I should have been more explicit.

The algorithm is a binary encoding of the ordinal values of the characters based on the accumulated level of recursion. For example the letter "J" is encoded as follows:
[ [[[[]]], [[]]], [[[]], []], [[]] ] Adding brackets to highlight the nesting of the arrayrefs: [ ([ ([[[ ]]]) , ([[ ]])) ]), ([ ([[ ]]) , ([ ]) ]), ([ ([ ] +) ]) ] 4 2 2 1 1 This gives: = 2**(4+2) +2**(2+1) +2**(1) = 2**(6) +2**(3) +2**(1) = 1001010b = 74 = ord('J');
Clever and artistic. ;-)

John.
--