Skip to content

Instantly share code, notes, and snippets.

Created October 29, 2015 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/92dd38d0bfe9f64d8944 to your computer and use it in GitHub Desktop.
Save anonymous/92dd38d0bfe9f64d8944 to your computer and use it in GitHub Desktop.
def alphabetize(arr, rev=false)
arr.sort!
if rev==true arr.reverse!
end
numbers = [0,3,5,6,7,2,3,4]
alphabetize(numbers)
puts numbers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment