Re: ASCII art from sourcecode as image

Eli the Bearded <*@eli.users.panix.com> Mon, 18 Oct 2021 23:20:00 -0000 (UTC)
Newsgroups alt.ascii-art,comp.lang.perl.misc
Organization Some absurd concept
Message-ID <[email protected]>
In comp.lang.perl.misc, Colin Randall  <[email protected]> wrote:
> On 11/10/2021 19:01, Eli the Bearded wrote:
>> has not tried using all the ancient versions of Perl he has access to
> ok ... thanks for that ... sorry to have put you to the trouble ...

That level of effort was no trouble. Digging out Perl v1.0.0 or the like
is doable, but trouble.

> so it was just an example of a "caligram" using the Acme::EyeDrops tool
> 
> if it had been C or Bash or even Pascal i would've been able to read it
> ... hadn't realized that Perl was so 'parentheses' heavy ... kind of
> looks like it was made with a bracket-generator :)

Perl is _extremely_ flexible with syntax, so you can write stuff using
either all punctuation or virtually no punctuation. Perl got a very
bad reputation for that ("write-only software") and Python reaped the
reward.

I know Perl well, and if I spent time I could figure out what how that
camel ASCII art works, but it's not immediately obvious to me. 

(I don't know Python well, but I can do some basic work in it.)

There used to be a tradition of writing short scripts that show-off
esoteric Perl knowledge and just print "just another perl hacker" or
similar. These went a long way to furthering the "Perl is hard to
read" reputation. I wrote this one in the late 1990s as an example of
"no punctuation":

perl -e 's Y Yreverse q N ny pm srekcah lrep kroy wen emosNYex and s Pmp ynP
P and s MsMjust sMx and print and s NYPM MPYN Nis or reverse and print q qq'

It prints "just some new york perl hackers " (trailing space is in output
but is just there for getting the two lines of code to be the same
length). It includes "NY" "PM" in a bunch of forms, referencing the New
York Perl Mongers group.

I've got some others in my old ~/sigs collection, two of which may be
interesting here:

$ perl ~/sigs/japh.I
     _           _        _                _   _               
    | |_   _ ___| |_     / \   _ __   ___ | |_| |__   ___ _ __ 
 _  | | | | / __| __|   / _ \ | '_ \ / _ \| __| '_ \ / _ \ '__|
| |_| | |_| \__ \ |_   / ___ \| | | | (_) | |_| | | |  __/ |   
 \___/ \__,_|___/\__| /_/   \_\_| |_|\___/ \__|_| |_|\___|_|   
                                                               
 ____           _   _   _            _             
|  _ \ ___ _ __| | | | | | __ _  ___| | _____ _ __ 
| |_) / _ \ '__| | | |_| |/ _` |/ __| |/ / _ \ '__|
|  __/  __/ |  | | |  _  | (_| | (__|   <  __/ |   
|_|   \___|_|  |_| |_| |_|\__,_|\___|_|\_\___|_|   

$ cat ~/sigs/japh.I
#!/usr/bin/perl -w
use Shell;
print(figlet(qw(Just Another Perl Hacker)));
__END__
$ perl ~/sigs/stpat.pl
Elijah




                               mmm mmm
                              MMMMVMMMM
                              VMMMMMMMV
                        mmmmm  VMMMMMV  mmmmm
                       JMMMMML  VMMMV  JMMMMML
                       VMMMMMMmmJMMMLmmMMMMMMV
                       :MMMMMMMMMMMMMMMMMMMMM:
                       1MMMMMM"""JP""""MMMMMM1
                       ?MMMMMP   V:    ?MMMMMV
                        """""    1L     """""
                                 "P





$ cat ~/sigs/stpat.pl
sub e{printf"%c",shift}for($b=141596885;$b>8;$b>>=4){&e(97-($b>>22)+($b&15))}$
_="}X/+c)cyX/*494yX/*979yX+e*959*eyX*I5Q*939*I5QyX*96bI3Qb69yX*!777!yX*Y6kIql"
."6YyX*A5q+9!,A59yX+m,YQ-myX/-iq~y";s:X:///:g;@b=/./g;$_=qq'Eli!: MV?JL1m"P\n'
;@e=/./sig;for($a=0;$a<128;){$b=ord$b[$a++];for(;$b&7;){&e(ord$e[($b-->>3)])}}
$

Elijah
------
reused some tricks from the C animation sig in the stpat one