The darker side of ruby

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 :slight_smile:
some ain't possible. i guess those people are pure or something :stuck_out_tongue:

Alex

···

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

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 :stuck_out_tongue:

It looks evil.. hmm nice.

···

On Wed, 16 Feb 2005 00:53:37 +0900, Alexander Kellett <ruby-lists@lypanov.net> wrote:

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