From: andrew mcelroy Date: 2012-06-07T10:37:21+09:00 Subject: Re: "Create a rock paper scissors program in ruby WITHOUT using conditionals" On Wed, Jun 6, 2012 at 8:24 PM, Ryan Davis wrote: > > On Jun 6, 2012, at 15:54 , Peter Zotov wrote: > >> Instead of this: >> >>  if arg == "a" >>    1 >>  elsif arg == "b" >>    2 >>  end >> >> ... you can use: >> >>  { "a" => 1, "b" => 2 }[arg] >> >> I leave the rest to your imagination. > > I think this is too limiting / not mind-expanding enough... > > I suggest looking at how smalltalk does branching (conditionals, loops, etc). excellent suggestion. Also consider how this could be done via delegation ala objective c style. > >