Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I was toying with Pattern Finding problem posted by artist and came up with a solution that I thought might make an interesting obfu. Read that thread to what its supposed to do (especially the updated rules)
use integer;$"="|";$\="\n";$S='Just Another Happy Perl Hacker';$C=5;$L += length($S);%0=();sub o{$l=shift;return 1 if(exists($0{"@$l"}));$0{"@$l +" }++;@n=0..$#$l;for$i(@n){for(@n){next if$i==$_;return 1 if index($$l[$ +i ],$$l[$_])!=-1}}0}@1=map{$_*length($S)/$C}0..$C-1;$.=0;while($.++<$L*1 +00 ){@0=();for(0..$C-1){my$str=($_==$C-1)?substr($S,$1[$_]):substr($S,$1[ +$_ ],$1[$_+1]-$1[$_]);push@0,$str;}$.=0,print"@0" unless(o(\@0));$;=rand( +@1 -1)+1;$1[$;]+=(rand(3)>1)?-1:1;$1[$;]=0 if$1[$;]<0;$1[$;]=$L-1 if$1[$; +] >=$L;$1[$;]=$1[$;-1]+1 if$;>0&&$1[$;]<=$1[$;-1];$1[$;]=$1[$;+1]-1 if$; +< $C-2&&$1[$;]>=$1[$;+1];}
Yves

--
You are not ready to use symrefs unless you already know why they are bad. -- tadmc (CLPM)


In reply to Pattern Matching Obfu by demerphq

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2024-04-20 13:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found