------art_80050_4473820.1182089005690
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,


Here's my solution: http://pastie.caboo.se/71188

It's of the dumb-brute-force-slow-as-hell variety:

$ time ./rq128_verbalarithmetic_rafc.rb 'send + more  oney'
{"m", "y", "n", "o", "d", "e", "r", "s"	}

real    2m51.197s
user    2m39.722s
sys     0m11.397s

$ time ./rq128_verbalarithmetic_rafc.rb 'forty + ten + ten  ixty'
{"x", "n", "y", "o"	, "e", "f", "r", "s", "i",
"t"}

real    7m28.151s
user    6m55.114s
sys     0m32.938s


But on the other hand, it can handle any operator as well as bases other
than 10. Did you know for instance that in base 9, ruby is worth up to 4
perls with some extra fun thrown in?

$ ./rq128_verbalarithmetic_rafc.rb 'n * perl + fun  uby' 9
{"l", "b", "y", "n", "e", "p", "f", "r", "u"}
{"l", "b", "y", "n", "e", "p", "f", "r", "u"}
{"l", "b", "y", "n", "e", "p", "f", "r", "u"}
{"l", "b", "y", "n", "e", "p", "f", "r", "u"}
{"l", "b", "y", "n", "e", "p", "f", "r", "u"}
{"l", "b", "y", "n", "e", "p", "f", "r", "u"}
{"l", "b", "y", "n", "e", "p", "f", "r", "u"}
{"l", "b", "y", "n", "e", "p", "f", "r", "u"}


Regards,
Raf

------art_80050_4473820.1182089005690--