Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Progressive JAPH

by Athanasius (Monsignor)
on Oct 06, 2012 at 06:41 UTC ( #997588=obfuscated: print w/ replies, xml ) Need Help??

OK, I’m sure this sort of thing must have been done before. But — well, it was a lot more fun to code it myself than to search for someone else’s implementation  ;-)

#! perl -w use strict;use Time::HiRes"usleep";sub o ($){hex$_[0]}++$|;my@t=(q,4a75737420,.qq ;616E6f74686572205065726c206861636B65;.q ,722c,)=~m,(..),xg;our($0,@c)=qq;%X;;sub _{print(qq,\r,,join('',map{chr hex}@c)); usleep(274**2)}sub r{sprintf($0,int(rand 0x5e)+040);}$c[$_]=r for+0..$#t;_;my@z=( -0..$#c);sub n{my($O)=@z;do{$O++if(o$c[$ _]==o$t[$_])}for@z;$O}do{for(@z){$c[$_]= r unless(o$c[$_]==o$t[$_])}},_ while@t>n

Enjoy!

Athanasius <°(((><contra mundum

Comment on Progressive JAPH
Download Code
Re: Progressive JAPH
by 2teez (Priest) on Oct 06, 2012 at 13:55 UTC

    Cool! Men I love this!!!

    If you tell me, I'll forget.
    If you show me, I'll remember.
    if you involve me, I'll understand.
    --- Author unknown to me
Re: Progressive JAPH
by MilanorTSW (Beadle) on Oct 09, 2012 at 09:46 UTC
    I saw something similar, but the algorithm was different. It still earns my ++.
Re: Progressive JAPH
by ambrus (Abbot) on Oct 09, 2012 at 20:39 UTC

    See also the similar Brute Force JAPH.

    I think there might have been at least one more similar japh, but I can't find it right now. I hope someone will point to it.

Re: Progressive JAPH
by ajam (Acolyte) on Oct 09, 2012 at 21:08 UTC

    Very cool.

    It took much longer the second time I ran it. Well, users like features and I'm a user. So if you feel like adding a feature, I suggest having a timeout which makes the correct letters get selected quicker.

      Special order for ajam:  ;-)

      #! perl -w use strict;use Time::HiRes"usleep";sub o ($){hex$_[0]}my@O=(q,4a75737420616E6f74, .qq;686572205065726c206861636B65722c;)=~ m,(..),xg;my(@o,@O0);sub O0{sprintf"%x", splice(@{$_[0]},int(rand(@{$_[0]})),1)}$ o[$_]=[040..0b1111110],$O0[$_]=O0($o[$_] )for-0..$#O;my$o0=+oO(\@O0,\@O);o0($o0,@ O0);O(\@O0,\@o,\@O),o0($o0,@O0)while$o0= &oO(\@O0,\@O)<@O;sub O{my($O,$o,$O0)=@_; for(0..$#$O){$O->[$_]=O0($o->[$_])if(o$O ->[$_]!=+o$O0->[$_])}}sub o0{--$|;my$oo= shift;print"\r",join('',map{chr(o($_))}@ _);usleep(0b1100100**02*(4+70*$oo/031))} sub oO{my($Oo,$O,$o)=(0,@_);for(0..$#$O) {++$Oo if o($O->[$_])==o($o->[$_])}$Oo;}

      Enjoy!

      Athanasius <°(((><contra mundum

        Thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://997588]
Approved by davido
Front-paged by kcott
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2014-12-20 01:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls