in reply to Re: Homework Golf
in thread Homework Golf
The second solution has a problem: each chop reduces $_ by one character until $_ is the empty string — which is what gets printed when $n is 65. My fix has 59 characters:
#23456789_123456789_123456789_123456789_123456789_123456789 perl -nlE"$w=$_;$n=0;$n+=ord(chop)-96while$_;$n==65&&say$w" words.txt
But the first solution can be reduced a little to 54 characters:
#23456789_123456789_123456789_123456789_123456789_1234 perl -nlE"$n=0;map$n+=$_-96,unpack'C*',$_;$n==65&&say" words.txt
:-)
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|