Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def winner(first, second)
- if (first[1].downcase == "p" && second[1].downcase == "r") ||
- (first[1].downcase == "r" && second[1].downcase == "s") ||
- (first[1].downcase == "s" && second[1].downcase == "p")
- return first
- elsif (second[1].downcase == "p" && first[1].downcase == "r") ||
- (second[1].downcase == "r" && first[1].downcase == "s") ||
- (second[1].downcase == "s" && first[1].downcase == "p")
- return second
- elsif (first[1].downcase == "p" && second[1].downcase == "p") ||
- (first[1].downcase == "r" && second[1].downcase == "r") ||
- (first[1].downcase == "s" && second[1].downcase == "s")
- return first
- else
- return false
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement