From: dblack@... Date: 2006-10-12T01:00:32+09:00 Subject: Re: Compact if statement for Codegolf Hi -- On Thu, 12 Oct 2006, Drew Olson wrote: > I'm working on my codegolfing skills and was wondering, what is the > shortest possible way to write the following in ruby: > > if a==0 > 1 > else > 2 > end The smallest I can think of is: a==0?1:2 David -- David A. Black | dblack@wobblini.net Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3] DABlog (DAB's Weblog) [2] | Co-director, Ruby Central, Inc. [4] [1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com [2] http://dablog.rubypal.com | [4] http://www.rubycentral.org