my$japh=q=815011301080222181506122815080025141102202911201=;
$[=1;my@a=(q,a,..q,u,,q, ,);
$_.=$a[join'',chop$japh,chop$japh]while length$japh;
print;
++
Here's some helpful pointers:
(My example and golf are at the end)
If you change "while length$japh" into simply "while$japh", you'll save yourself 7 characters and the length function (slightly speeding it up and making it smaller).
You can also free things up a tad by replacing "$japh" with "$_". This will allow you to change the "chop$japh" into just plain "chop" (or if you want to be strict, "chop()"). And it will also allow you to shorten that "while" even more, by making it "while$_". Oh yah, it also does away with the "my" declaration (saving 2 characters).
Now if you want to go a step further, you can change "@a" into "@_". This does away with the "my" declaration, and confuses some by having two "$_"'s. One is an array and another is a variable, so you don't have to worry about a conflict.
See the "$_.="? That's an unnecessary concatenation if your just returning it directly. So why not just make it a straight "print". (It will slow things down a bit due to the fact that print is called a number of times, but it shortens the overall length).
Rather than "join"ing with a null value, why not just concatenate the "chop"s? "join'',chop(),chop()" eq "chop().chop()". (And it's faster too).
I'll do some more digging after this example, solely for personal gratification 8^) ...
Let's see this so far:
$_=q=815011301080222181506122815080025141102202911201=;
$[=1;
@_=(q,a,..q,u,,q, ,);
print$_[chop().chop()]while$_
This gives the same output as the original.
Now for some inno golfing...
$_=unpack'w*','Ÿ¢ŽÞ»Ðªè„Ž¦åŠ™ÿÜ½Æ…ŽŽËr'
if@_=('a'..'u',' ');print$_[chop().chop()]
while$_
If that won't work for you, set "$_" equal to '714001200070121171405112714070914131001291810290' rather than using the unpack function.
Cheers,
-inno | [reply] [d/l] [select] |