Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Comments on my first attempt at a JAPH

by grep (Monsignor)
on Dec 21, 2001 at 08:03 UTC ( [id://133708]=obfuscated: print w/replies, xml ) Need Help??

Ok this is my very first attempt at a JAPH. I need a barometer on whether or not it is any good. So I ask my perl monk brothers to comment or rip apart.
#!/usr/bin/perl $a='grep';@a=(g..r,e..p);printf("%c%c%c%c",($a=~y;grep;map;)+70,65,len +gth(join(';',reverse(split //,++$a)))+$#a+50,$a=~s;mapq;grep\;grep\;g +rep;+56+$a=~y;g;j;+$a=~y;r;a;+$a=~y;e;m;+$a=~y;p;h;+$a=~tr;m;p;);$a=( +split/;/,$a)[0];
THX grep
grep> cd pub grep> more beer

Replies are listed 'Best First'.
Re: Comments on my first attempt at a JAPH
by jryan (Vicar) on Dec 22, 2001 at 07:05 UTC

    I enjoyed this one, so I decided to deobfu it. I don't normally like many japhs, as they are too simple, but this one isn't. It is quite tricky without using hardly any minor obfusucations at all. Well done, ++ :)

    #!/usr/bin/perl # shebang : NO -w!! :) # NO STRICT ?!?!?! :) $a='grep'; # sets $a to the literal string 'grep' @a=(g..r,e..p); # sets @a to qw(g h i j k l m n o p q r e # f g h i j k l m n o p) printf( "%c%c%c%c", # printf. This will work like chr; the # first 4 arguments will be turned into # ascii characters regardless of what # they are. printf, like print, also # takes a list as an argument; take a # guess on how many he is passing :) ($a=~y;grep;map;)+70, # argument uno. First off, he is taking the # transliteration (thats a y delimited by ;) in scalar # context, so that it will return the number of characters # replaced, which is 4. Then he adds 70 for a result of 74 # as a side effect, $a is now equal to mapp. 65, # argument 2. If you can't figure out what it equals, # you are hearby banished from the monastery! length(join(';',reverse(split //,++$a))) + $#a + 50, # arg 3. Starting innermost: first, $a is magically ++ed # to make it mapq. Then its split on nothing, returning, # a list of length 4. this is reversed, and then joined # with ; to make a string of 'q;e;r;g'. Finally, the length # of that is returned (7), added to 50, and finally # the last index of @a (24) is added upon that. The result is 81. # next up is arg #4. $a=~s;mapq;grep\;grep\;grep; # the substitution operator is applied to $a, making the value # of $a = grep;grep;grep. Don't be fooled by the backslashed # ; As a side effect, the substitution is true, so 1 is # returned. +56+ # thats added to 56 (now 57) $a=~y;g;j; # $a is now jrep;jrep;jrep, also, as a side effect, 3 (the # number of substitutions) is returned (now 60) + # $a is is jaep;jaep;jaep (63) $a=~y;r;a; + # $a is jamp;jamp;jamp (66) $a=~y;e;m; + # $a is jamh;jamh;jamh (69) $a=~y;p;h; + # $a is japh;japh;japh (72) $a=~tr;m;p; ); # japh is now printed (i think), but just for kicks, # he decides to through this in, making $a="japh" :) $a=(split/;/,$a)[0];
(crazyinsomniac) Re: Comments on my first attempt at a JAPH
by crazyinsomniac (Prior) on Dec 21, 2001 at 12:21 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: obfuscated [id://133708]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (1)
As of 2024-04-16 14:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found