Skip to content

Instantly share code, notes, and snippets.

@CodePint
Created July 2, 2018 03:49
Show Gist options
  • Save CodePint/b7339d35e29ad13010a59be3a211fcf5 to your computer and use it in GitHub Desktop.
Save CodePint/b7339d35e29ad13010a59be3a211fcf5 to your computer and use it in GitHub Desktop.
# comparing kickers
def check_kickers(other)
self.highest_hand[:high_cards].reverse!
other.highest_hand[:high_cards].reverse!
return_value = nil
self.highest_hand[:high_cards].each do |self_card|
other.highest_hand[:high_cards].each do |other_card|
if self_card > other_card
return_value = 1
elsif self_card < other_card
return_value = 2
end
end
return_value ||= 3
return return_value
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment