I\'m in an introductory software development class, and my homework is to create a rock paper scissors program that takes two arguments (rock, paper), etc, and returns the arg t
A simple hash to the rescue:
def tell_me(a1, a2) input = [a1 , a2].sort.join('_').to_sym rules = { :paper_rock => "paper", :rock_scissor => "rock", :paper_scissor => "scissor"} rules[input] end