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
I just think the simplest solution has to be something like:
@results = { 'rock/paper' => 'paper', 'rock/scissors' => 'rock', 'paper/scissors' => 'scissors', 'paper/rock' => 'paper', 'scissors/paper' => 'scissors', 'scissors/rock' => 'rock' } def winner p1, p2 @results["#{p1}/#{p2}"] end