Re: Briskets (perl)
Re: Briskets (perl)
- Subject: Re: Briskets (perl)
- From: Michael Kelly <email@hidden>
- Date: Mon, 13 May 2002 19:08:29 -0700
On 5/13/02 4:40 PM, Matthew Stuckwisch <email@hidden> wrote:
>
> #!/usr/bin/perl
>
> # Michael Kelly
>
> $s="-oMmi\ncThhaee lW eKbe:l lhyt".
>
> "\ntEpm:a/i/lw:w wj.ejdeidmiimkie".
>
> "k\@em.ance.tc\n";for$i (0..length(
>
> $s)/2-1){$a.=substr($s,$i*2,1);$b.=
>
> substr($s,($i*2)+1,1);}print"$a$b";
>
>
Oh jeez, go and make such a simple script look so ugly. For those of you
>
who prefer "cleaner" perl:
>
>
---
>
$s="-oMmi\ncThhaee lW eKbe:l lhyt"."\ntEpm:a/i/lw:w wj.ejdeidmiimkie"."k\@
>
em.ance.tc\n";
>
>
for$i(0..length($s)/2-1)
>
{
>
$a.=substr($s,$i*2,1);
>
$b.=substr($s,($i*2)+1,1);
>
}
>
>
print"$a$b";
>
---
>
>
and for those of you who want a rough AppleScript conversion:
>
>
---
>
set s to "-oMmi
>
cThhaee lW eKbe:l lhyt
>
tEpm:a/i/lw:w email@hidden
>
"
>
>
set a to ""
>
set b to ""
>
>
repeat with i from 0 to round (length of s) / 2 - 1
>
set a to a & text (2 * i + 1) thru (2 * i + 1) in s
>
set b to b & text (2 * i + 2) thru (2 * i + 2) in s
>
end repeat
>
>
return a & b
Hey, I could actually learn a bit from that code. Thanks! :)
>
Trying to go and make perl all bad....humbug :P
Actually, I must admit that I prefer Perl to AppleScript (gasp!), and the
code I used was obviously obfuscated on purpose. Just trying to be funny. :)
I'm still working on ways to obfuscate that code even further, btw. ;) I
suppose it might be people like me making lousy jokes like these that might
give Perl a reputation of "having the syntax of line noise", though, so I
guess I should cut it out.
Then again, I've seen some AppleScript that beats that little bit right into
the ground as far as nonunderstandability goes, so I guess the sword cuts
both ways.
--
Michael
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.