Guest User

Untitled

a guest
Feb 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. class Hand
  2. def straight?
  3. values = @cards.map{|card| card.value}.uniq.sort
  4. values.each do |key, value|
  5. values.delete_at(key) unless value == values[key - 1] + 1
  6. end
  7. values.length >= 5
  8. end
  9. end
Add Comment
Please, Sign In to add comment