Skip to content

Instantly share code, notes, and snippets.

@CodePint
Created July 2, 2018 04:54
Show Gist options
  • Save CodePint/f1e1ffa9f240b6678dbf2a5f8409bf84 to your computer and use it in GitHub Desktop.
Save CodePint/f1e1ffa9f240b6678dbf2a5f8409bf84 to your computer and use it in GitHub Desktop.
# comparing kickers
def check_kickers(other)
return_value = nil
self_array = self.highest_hand[:high_cards].sort!
other_array = other.highest_hand[:high_cards].sort!
if self_array == other_array
return_value = 3
else
loop do
self_num = self_array.pop(1)
other_num = other_array.pop(1)
if self_num.first > other_num.first
return_value = 1
break
elsif self_num.first < other_num.first
return_value = 2
break
end
end
end
return return_value
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment