Skip to content

Instantly share code, notes, and snippets.

@imownbey
Created December 16, 2008 05:46
Show Gist options
  • Save imownbey/36337 to your computer and use it in GitHub Desktop.
Save imownbey/36337 to your computer and use it in GitHub Desktop.
class Hand
def straight?
values = @cards.map{|card| card.value}.uniq.sort
values.each do |key, value|
values.delete_at(key) unless value == values[key - 1] + 1
end
values.length >= 5
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment