Skip to content

Instantly share code, notes, and snippets.

@jeremywrowe
Created October 8, 2012 16:28
Show Gist options
  • Save jeremywrowe/3853422 to your computer and use it in GitHub Desktop.
Save jeremywrowe/3853422 to your computer and use it in GitHub Desktop.
id-tap-that-4
def top_three_scores
player_scores = [2,1,4,3].sort
player_scores.reverse!
player_scores.tap{|a| a.pop }
end
top_three_scores # => [4,3,2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment