Re: ASCII art from sourcecode as image

17 views
Skip to first unread message

Eli the Bearded

unread,
Oct 11, 2021, 2:01:39 PM10/11/21
to
In alt.ascii-art, colin randall <colin.r...@googlemail.com> wrote:
> On Wednesday, July 16, 2003 at 9:07:44 AM UTC+1, Harry Mason wrote:

I'd make a suggestion, but 19 years later it might not help.

> For perl there is Acme::EyeDrops. It doesn't just format the program, it
> obfuscates it too.
>
> -- 8< -- cut here -- >8 --
> #!/usr/bin/perl -w
> eval eval '"'.
>
>
> ('#').
> '!'.'/' .('['
> ^'.' ) .('['^'('). ("\["^
> ')')."\/".( '`'|'"').('`'| ')').(
> '`'|'.') .'/'. ( '['^'+').('`'|'%').('['
> ^')').('`'|',').('{' ^'[').'-'.('['^',').('!'
> ^'+').('['^'.').('['^ '(').('`'|'%').('{'^('[')).(
> '['^'(').('['^'/').( '['^')').('`'|')').('`'|'#').("\["^
> ('/')). ';'.('!'^'+').('['^'+').('['^"\)").(
> '`'|')').('`'|'.').('['^'/').('{'^'[').'\\'.'"'.('`'|'(').(
> '`'|'%').('`'|',').('`'|',').('`'|'/').','.('{'^'[').('['^','
> ).('`'|'/').('['^')').('`'|',').('`'|'$').'\\'.'\\'.('`'|"\.").
> '\\'.'"'.';'.('!'^'+').'"';$:='.'^'~';$~='@'|'(';$^=')'^'[';$/=
> '`'|'.';$_='('^'}';$,='`'|'!';$\=')'^'}';$:='.'^'~';$~='@'|'(';
> $^=')'^'[';$/='`'|'.';$_='('^'}';$,='`'|'!';$\=')'^'}';$:="\."^
> '~';$~='@'|'(';$^=')'^'[';$/='`'|'.';$_='('^'}';$,='`'|('!');$\=
> ')'^'}';$:='.'^'~';$~='@'|'(';$^=')'^'[';$/='`'|'.';$_='('^'}';
> $,='`'|'!';$\=')'^'}';$:='.'^'~';$~='@'|'(';$^=')'^'[' ;($/)=
> '`'|'.';$_='('^'}';$,='`'|'!';$\=')'^'}';$:='.'^'~'; ($~)=
> '@'|'(';$^=')'^'[';$/='`'|'.';$_='('^'}';$,=('`')| "\!";
> $\=')'^'}';$:='.'^'~';$~='@'|'(';$^=')' ^'[';$/= '`'|
> (( '.'));$_='('^'}';$,='`'|"\!";$\= ')'^'}'; ($:)
> ='.'^"\~"; $~='@'|'(' ;$^=')'^ '[';$/= '`'
> |('.');$_= '('^'}';$, ='`'|'!' ;$\=')' ^+
> "\}";$:= '.'^'~';$~ =('@')| '(';$^
> =')'^'[' ;$/=('`')| '.';$_= "\("^
> '}';$,= '`'|'!';$\ ="\)"^ '}';$:
> =('.')^ "\~";$~= ('@')| "\(";
> $^=')' ^"\["; $/='`' |'.';
> ($_)= ('(')^ '}';$, ='`'|
> "\!"; $\=')'^ '}';$: ='.'
> ^'~'; $~='@'|'(' ;$^=
> ')'^ "\[";$/= '`'|
> '.'; $_=('(')^ '}';
> ($,) ='`'|'!';$\ =')'^
> "\}"; $:='.'^'~';$~= ('@')|
> "\("; $^="\)"^ '['; $/='`'|
> '.';$_= '('^'}';
> $,="\`"| '!';#;
> -- 8< -- cut here -- >8 --

> Thats an interesting piece of art
> i dont have perl installed and i'd be curious to know what its output
> looks like

It just prints "hello, world".

There are a bunch more examples in the documentation for Acme::EyeDrops,
but trying a few, I was unable to get them to produce output (other
than errors[*]). Chances are the output ASCII art code is rather
sensitive to changes in Perl syntax.

https://metacpan.org/pod/Acme::EyeDrops

[*] Example, with Perl v5.26.1
Eval-group not allowed at runtime, use re 'eval' in regex
m/(?{eval"\$~=pop||'';open\$%;y,!-~,#,,s,(.).,\$+,gs,\$~&&(\$_=reverse)for\@~=grep\$|--,('')x18,<0>;\@;=map~~reverse,re.../
at /tmp/p line 48.
For the similarly shapped "camel.pl"

Elijah
------
has not tried using all the ancient versions of Perl he has access to

Colin Randall

unread,
Oct 17, 2021, 2:35:43 PM10/17/21
to
ok ... thanks for that ... sorry to have put you to the 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 :)

--
.
._!__ __ __
/ _\/_ |_ \!_
/ / 7 / /|
\ \_ _/ / \ .
\_//__/|_\_\!_.
|

Eli the Bearded

unread,
Oct 18, 2021, 7:20:04 PM10/18/21
to
In comp.lang.perl.misc, Colin Randall <colin.r...@gmail.com> 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

Christian Garbs

unread,
Oct 23, 2021, 2:58:11 PM10/23/21
to
Eli the Bearded <*@eli.users.panix.com> wrote:

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

UUOP ;-)

I finally found an old one of mine:

($a,$b,$c)=localtime time;sub a{int(31+sin($_[0]/57)*$_[1]).int(#mi...@cgarbs.de
31-cos($_[0]/57)*$_[1])}for(3..50){$i{a($b*6,$_/3)}++;$i{a($c*30%360+$b/2,$_/5)}
++}for(0..359){$i{a($_,19)}++;$i{a($_,16)}++if!($_%30)}for$y(6..26){for(11..52){
print((' ','"','o','8')[(exists$i{$_.$y*2})*2+exists$i{$_.($y*2-1)}])}print"\n"}

I won't post the output, try to guess ;-)

Hint: The output changes regularly, you could run it in a loop like
"while perl the_script.pl; do sleep 1m; done".

This still runs with a current Perl, even with -w enabled.

Best regards
Christian
--
....Christian.Garbs....................................https://www.cgarbs.de
Murphy's Laws of Combat:
20. Never forget that your weapon is made by the lowest bidder.

Colin Randall

unread,
Oct 28, 2021, 10:20:52 PM10/28/21
to
On 23/10/2021 19:58, Christian Garbs wrote:
> Eli the Bearded <*@eli.users.panix.com> wrote:
>
>> $ cat ~/sigs/japh.I
>> #!/usr/bin/perl -w
>> use Shell;
>> print(figlet(qw(Just Another Perl Hacker)));
>> __END__
>
> UUOP ;-)
>
> I finally found an old one of mine:
>
> ($a,$b,$c)=localtime time;sub a{int(31+sin($_[0]/57)*$_[1]).int(#mi...@cgarbs.de
> 31-cos($_[0]/57)*$_[1])}for(3..50){$i{a($b*6,$_/3)}++;$i{a($c*30%360+$b/2,$_/5)}
> ++}for(0..359){$i{a($_,19)}++;$i{a($_,16)}++if!($_%30)}for$y(6..26){for(11..52){
> print((' ','"','o','8')[(exists$i{$_.$y*2})*2+exists$i{$_.($y*2-1)}])}print"\n"}
>
> I won't post the output, try to guess ;-)
>
> Hint: The output changes regularly, you could run it in a loop like
> "while perl the_script.pl; do sleep 1m; done".
>
> This still runs with a current Perl, even with -w enabled.
>
> Best regards
> Christian
>
a guess:
a circular motion of an email-addy leaving a trail


the following looks like it could be the original camel?

originally posted by Philip Taylor:
And here's another Perl camel, copied from
http://www.perl.com/CPAN-local/misc/japh :

#!/usr/bin/perl -w
use strict;

$_='ev
al("seek\040D
ATA,0, 0;");foreach(1..3)
{<DATA>;}my @camel1hump;my$camel;
my$Camel ;while( <DATA>){$_=sprintf("%-6
9s",$_);my@dromedary 1=split(//);if(defined($
_=<DATA>)){@camel1hum p=split(//);}while(@dromeda
ry1){my$camel1hump=0 ;my$CAMEL=3;if(defined($_=shif
t(@dromedary1 ))&&/\S/){$camel1hump+=1<<$CAMEL;}
$CAMEL--;if(d efined($_=shift(@dromedary1))&&/\S/){
$camel1hump+=1 <<$CAMEL;}$CAMEL--;if(defined($_=shift(
@camel1hump))&&/\S/){$camel1hump+=1<<$CAMEL;}$CAMEL--;if(
defined($_=shift(@camel1hump))&&/\S/){$camel1hump+=1<<$CAME
L;;}$camel.=(split(//,"\040..m`{/J\047\134}L^7FX"))[$camel1h
ump];}$camel.="\n";}@camel1hump=split(/\n/,$camel);foreach(@
camel1hump){chomp;$Camel=$_;y/LJF7\173\175`\047/\061\062\063\
064\065\066\067\070/;y/12345678/JL7F\175\173\047`/;$_=reverse;
print"$_\040$Camel\n";}foreach(@camel1hump){chomp;$Camel=$_;y
/LJF7\173\175`\047/12345678/;y/12345678/JL7F\175\173\0 47`/;
$_=reverse;print"\040$_$Camel\n";}';;s/\s*//g;;eval; eval
("seek\040DATA,0,0;");undef$/;$_=<DATA>;s/\s*//g;( );;s
;^.*_;;;map{eval"print\"$_\"";}/.{4}/g; __DATA__ \124
\1 50\145\040\165\163\145\040\157\1 46\040\1 41\0
40\143\141 \155\145\1 54\040\1 51\155\ 141
\147\145\0 40\151\156 \040\141 \163\16 3\
157\143\ 151\141\16 4\151\1 57\156
\040\167 \151\164\1 50\040\ 120\1
45\162\ 154\040\15 1\163\ 040\14
1\040\1 64\162\1 41\144 \145\
155\14 1\162\ 153\04 0\157
\146\ 040\11 7\047\ 122\1
45\15 1\154\1 54\171 \040
\046\ 012\101\16 3\16
3\15 7\143\15 1\14
1\16 4\145\163 \054
\040 \111\156\14 3\056
\040\ 125\163\145\14 4\040\
167\1 51\164\1 50\0 40\160\
145\162 \155\151
\163\163 \151\1
57\156\056

Colin Randall

unread,
Oct 29, 2021, 3:46:50 AM10/29/21
to
[begin script output]
mJXXLm. .mJXXLm
JXXXXXXXXL. JXXLm. .mJXXL .JXXXXXXXXL
{XXXXXXXXXXX. JXXXmXXXXm mXXXXmXXXL .XXXXXXXXXXX}
.XXXXXXXXXXXXXL. {XXXXXXXXXF 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mXXXXXXX.
{XXXXXXXXXXXXXXXXXXXXXXXXXXXXX. .XXXXXXXXXXXXXXXXXXXXXXXXXXXXX}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXF
7XXXXXXXXXXXXXXXXXXXXXXXXXF`XX XX'7XXXXXXXXXXXXXXXXXXXXXXXXXF
`7XXXXXXXXXXXXXXXXXXX7XXX} XX XX {XXXFXXXXXXXXXXXXXXXXXXXF'
`' XXXXX^XXXXX7XXXF`XXX}{X' `X}{XXX'7XXXFXXXXX^XXXXX `'
7XXXF XXXXX`XXX} `XXX`' `'XXX' {XXX'XXXXX 7XXXF
{XXX'{XXXX} 7XX} {XX. .XX} {XXF {XXXX}`XXX}
{XXF {XXF' JXX' XX} {XX `XXL `7XX} 7XX}
XX} 7XXm JXX' XX' `XX `XXL mXXF {XX
XX' 7XXXF XX XX 7XXXF `XX
.XF .XXXXL .XX XX. JXXXX. 7X.
XX} .XXXF7XF JXX} {XXL 7XF7XXX. {XX
mXXX' `XXX' `XXX' `XXXm
^^^^^ ^^^^^

And all the camels are the same shape as the picture on the front of the
book Programming Perl which, according to the book's Colophon, is "a
camel (one-hump dromedary)"...

... so no i know

A.T. Murray

unread,
Nov 10, 2021, 9:07:05 AM11/10/21
to
http://ai.neocities.org/RoboMind.html -- ASCII art of a Robot AI Mind in Perl

Mentifex
--
https://cyborg.blogspot.com -- Cyborg weblog
https://ai.neocities.org/theory.html -- How the Mind Works
https://www.amazon.com/dp/B007ZI66FS -- The Art of the Meme
https://medium.com/tag/mentifex/archive

gamo

unread,
Nov 12, 2021, 4:56:25 AM11/12/21
to
El 10/11/21 a las 15:06, A.T. Murray escribió:

> http://ai.neocities.org/RoboMind.html -- ASCII art of a Robot AI Mind in Perl

A good graph, but be careful not to go all the way down to reproduce
1) metal issues (most obvious thing)
2) temporal weakness which affects decisions or the decision proccess
3) obsessions (maybe love is a kind of positive one)
4) cognitive limitations
et cetera

And as a matter of design, how do you implement brain plasticity?

--
http://gamo.sdf-eu.org/
perl -E 'say "Error: Robotic psycho captcha not ok"'

A.T. Murray

unread,
Nov 12, 2021, 10:33:15 AM11/12/21
to
On Friday, November 12, 2021 at 1:56:25 AM UTC-8, gamo wrote:
> El 10/11/21 a las 15:06, A.T. Murray escribió:
> > http://ai.neocities.org/RoboMind.html -- ASCII art of a Robot AI Mind in Perl
> A good graph, but be careful not to go all the way down to reproduce
> 1) mental issues (most obvious thing)
> 2) temporal weakness which affects decisions or the decision process
| 3) obsessions (maybe love is a kind of positive one)
"Comes love, nothing can be done."
> 4) cognitive limitations
> et cetera
>
| And as a matter of design, how do you implement brain plasticity?

If "brain plasticity" is an ability of the AI Mind to learn and grow over time, then it is implemented with features like the NewConcept mind-module.

Mentifex
--
https://cyborg.blogspot.com -- Cyborg weblog
https://ai.neocities.org/PMPJ.html -- Perl Mind Programming Journal

gamo

unread,
Nov 14, 2021, 4:05:30 PM11/14/21
to
El 12/11/21 a las 16:33, A.T. Murray escribió:
> If "brain plasticity" is an ability of the AI Mind to learn and grow over time, then it is implemented with features like the NewConcept mind-module.
>
> Mentifex

You can call it metiflex.pm


--
http://gamo.sdf-eu.org/
perl -E 'say "Error: The flat tax is not flat"'
Reply all
Reply to author
Forward
0 new messages