From: Robert Klemme Date: 2006-12-31T23:00:08+09:00 Subject: Re: Newbie: It works, how can I make it better? On 30.12.2006 21:02, Jay Bornhoft wrote: > I wrote this little prog giving the user two choices. > > I would really appreciate any advice on how I can improve anything about > this program (structure, layout, etc) Since you're doing a single conversion only, you could as well use command line arguments. I have also added automatic detection of the conversion direction with Fahrenheit being the default input value using regular expressions. You could use that technique in an interactive version as well thus improving usability (because you do have to enter one value only vs. two values). Sample execution $ ruby cf.rb 10c "10 f" 20 Temperature conversion +10.0C is -12.2F +10.0F is +50.0C +20.0F is +68.0C Kind regards robert puts <