Skip to content

Instantly share code, notes, and snippets.

@CodePint
Created July 1, 2018 21:10
Show Gist options
  • Save CodePint/520f9f94e4ea8d65647c9073100bde7b to your computer and use it in GitHub Desktop.
Save CodePint/520f9f94e4ea8d65647c9073100bde7b to your computer and use it in GitHub Desktop.
# 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