On Fri, 14 Nov 2008 14:20:42 -0500, Matthew Moss wrote:


>>> Your task is to write a units converter script. The input to the
>>> script must be three arguments: the quantity, the source units, and
>>> the destination units. The first example above would be run like this:
>>>
>>>      $ ruby convert.rb 50 miles kilometers
>>>
>>> Or, using abbreviations:
>>>
>>>      $ ruby convert.rb 50 mi km
>>>
>>> Support as many units and categories of units (i.e. volume, length,
>>> weight, etc.) as you can, along with appropriate abbreviations for
>>> each unit.
>>
>> This will be interesting. I'm not going to endeavor into myself b/c I
>> help maintain Stick (http://stick.rubyforge.org) which already does
>> this (and there's another lib out there that does it too). But it will
>> be interesting to see how others approach it.
> 
> Note to everyone else: using another lib, such as stick, is considered
> cheating for this quiz.  :D

I disagree, and think that if he actually has a useful lib, he should 
show it off. When I wrote Quiz #95 (Code to S-Exp), it was useful to me 
to see the rubynode and ParseTree solutions, even if some would have 
considered that cheating. I wound up using the rubynode version for the 
Ruby 1.8 version of the library I was writing.

(Or maybe if you say it's cheating, that means he's allowed to talk about 
it during the spoiler period.)

--Ken

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/