Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: (almost) foldlby Grimy (Pilgrim) |
on Jun 07, 2011 at 22:57 UTC ( [id://908596]=note: print w/replies, xml ) | Need Help?? |
Well, in unary, summing is as simple as concatenating. And Perl has a built-in decimal-to-unary converter (the x operator), as well as a built-in unary-to-decimal converter (the length function). Putting all this together:
But your implementation sure is fun :-) EDIT: Look at tye's code instead. This one is stupid. Don't know what I had in mind when I wrote 'length join "", '.
In Section
Obfuscated Code
|
|