Well, I think I can send it now. My implementation is onhttp://pastie.caboo.se/71198.

On 6/16/07, Aureliano Calvo <aurelianocalvo / gmail.com> wrote:> Mi implementation is "working". For instance:>> ./quiz_128.rb "a+b=c"> a: 5> b: 1> c: 6>> But> ./quiz_128.rb "send+more=money" is taking ages!>> time ./quiz_128.rb "send+more=money"> m: 1> y: 2> n: 6> o: 0> d: 7> e: 5> r: 8> s: 9>> real    7m17.065s> user    2m46.806s> sys     0m6.676s>>> Is there some trick to cut the solution space (I'm just scanning the> solution space) ? I know I have a crappy PC but I have a feeling that> this is not the real problem! When can I send my solution to be> reviewed?>> > The three rules of Ruby Quiz:> >> > 1.  Please do not post any solutions or spoiler discussion for this quiz until> > 48 hours have passed from the time on this message.> >> > 2.  Support Ruby Quiz by submitting ideas as often as you can:> >> > http://www.rubyquiz.com/> >> > 3.  Enjoy!> >> > Suggestion:  A [QUIZ] in the subject of emails about the problem helps everyone> > on Ruby Talk follow the discussion.  Please reply to the original quiz message,> > if you can.> >> > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=> >> > A famous set of computer problems involve verbal arithmetic.  In these problems,> > you are given equations of words like:> >> >           send> >         + more> >         ------> >          money> >> > or:> >> >           forty> >             ten> >         +   ten> >         -------> >           sixty> >> > The goal is to find a single digit for each letter that makes the equation true.> > Normal rules of number construction apply, so the first digit of a multi-digit> > number should be nonzero and each letter represents a different digit.> >> > This week's quiz is to build a program that reads in equations and outputs> > solutions.  You can decide how complex of an equation you want to support, with> > the examples above being the minimum implementation.> >> > Here's a solution you can test against:> >> >         $ ruby verbal_arithmetic.rb 'send+more=money'> >         s: 9> >         e: 5> >         n: 6> >         d: 7> >         m: 1> >         o: 0> >         r: 8> >         y: 2> >> >>>> --> "Es también nuestra intención erradicar la corrupción, ofreciendo como> norma la honestidad, la idoneidad y la eficiencia. Con madurez y> sentido de unidad es fácil pensar en la recomposición del ser> argentino. Ese ser argentino, basado en madurez y en sentido de> unidad, permitirá inspirar para elevarnos por encima de la miseria que> la antinomia nos ha planteado, para dejar, de una vez por todas, ese> ser "anti" y ser, de una vez por todas, "pro": "Pro argentinos"">> Jorge Rafael Videla para el 25 de mayo de 1976>

-- "Es también nuestra intención erradicar la corrupción, ofreciendo comonorma la honestidad, la idoneidad y la eficiencia. Con madurez ysentido de unidad es fácil pensar en la recomposición del serargentino. Ese ser argentino, basado en madurez y en sentido deunidad, permitirá inspirar para elevarnos por encima de la miseria quela antinomia nos ha planteado, para dejar, de una vez por todas, eseser "anti" y ser, de una vez por todas, "pro": "Pro argentinos""
Jorge Rafael Videla para el 25 de mayo de 1976