Skip to content

Instantly share code, notes, and snippets.

@tyler-smith
Created October 9, 2012 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyler-smith/3859855 to your computer and use it in GitHub Desktop.
Save tyler-smith/3859855 to your computer and use it in GitHub Desktop.
def rps_result(m1, m2)
return {:r => {:s => :r, :p => :p},
:p => {:r => :p, :s => :s},
:s => {:p => :s, :r => :r}}[m1][m2]
end
puts rps_result(:r, :p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment