So my code works and passes fine, I understand what it's doing.
But, unless I'm misunderstanding the instruction, my code should output the numbers in reverse order, but they are coming out as ascending order. Since the argument makes rev==true, why isn't it printing out in reverse?
def alphabetize (arr, rev=false) arr.sort! if rev==true arr.reverse! else arr.sort! end end numbers = [9, 94, 81, 31, 22] puts alphabetize (numbers)