Created
October 9, 2012 16:24
-
-
Save tyler-smith/3859855 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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