On Dec 1, 5:27 pm, Todd Benson <caduce... / gmail.com> wrote:
> On Dec 1, 2007 4:18 PM, Daniel Martin <mar... / snowplow.org> wrote:
>
> > "Christian von Kleist" <cvonkle... / gmail.com> writes:
> > But:
>
> > '1 2 - 3 4 - -' should become '1 - 2 - (3 - 4)'
>
> Or '1 - 2 - 3 + 4'  (yikes!) :^0

Well one feature of the Ruby Quiz is that our Quiz Master generally
allows submitters quite a bit of flexibility in reinterpreting the
problem.  To me, however, that form seems outside the problem
description, as you're a) applying the distributive property, and b)
ending up with a different set of operators than what you started with
(from 3 minuses to 2 minuses and 1 plus).

And once you start down the road '4 2 3 + *' could become '4 * (2 +
3)', '8 + 12', or even '20'.

Eric

====

Are you interested in on-site Ruby training that's been highly
reviewed by former students?  http://LearnRuby.com