Created
July 1, 2018 21:10
-
-
Save CodePint/520f9f94e4ea8d65647c9073100bde7b 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
# finding out if the hand contains a straight and what its high is. | |
def find_straights | |
straight = Array.new | |
@cards.each_with_index do |card, index| | |
binding.pry | |
if index == (@cards.length - 1) | |
straight << card | |
end | |
if (card[:value] += 1) == (@cards[index+1][:value]) | |
straight << card | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment