-
-
Save anonymous/92dd38d0bfe9f64d8944 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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