[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

the darker side of ruby

Alexander Kellett

2/15/2005 3:54:00 PM

during a few bored moments last night i wrote some code to make this:

ruby -e "p
((((((((((((((((?A)-?L)-?E)%?X)/?A)-?N)*?D)%?E)%?R)*?K)-?E)*?L)-?L)/?
E)*?T)/?T)"

from a name;

first put in your name or whatever:
g="ALEXANDERKELLETT";c=0;loop{t=[];v=(g.unpack"c*").inject{|s,n|l=%w(+
* - / %)[rand 5];t<<l;;break if (l=="/"||l=="%")&&n==0;s.__send__
l,n};if v==666;puts "got it in #{c} tries! with
#{t.join}";break;end;c+=1}

then make l the output of above:
l="--%/-*%%*-*-/*/";t=0;
h=("ALEXANDERKELLETT".unpack"c*").map{|b|s="?"+b.chr+")"+l[t,1];t+=1;
s}.join;"("*(l.size+1)+h

and you'll get your string :)
some ain't possible. i guess those people are pure or something :P

Alex

----
p
((((((((((((((((?A)-?L)-?E)%?X)/?A)-?N)*?D)%?E)%?R)*?K)-?E)*?L)-?L)/?
E)*?T)/?T)



1 Answer

Simon Strandgaard

2/15/2005 9:53:00 PM

0

On Wed, 16 Feb 2005 00:53:37 +0900, Alexander Kellett
<ruby-lists@lypanov.net> wrote:
> during a few bored moments last night i wrote some code to make this:
[snip]
> some ain't possible. i guess those people are pure or something :P

It looks evil.. hmm nice.

--
Simon Strandgaard
'-NEON-EYE-'.unpack('C*').inject(0){|a,b|a+b} #-> 666