Sorting cant understand debugg error


def alphabetize(arr,rev =false)
puts numbers
numbers = [5, 1, 3, 8]

gives me :
(ruby):5: syntax error, unexpected '\n', expecting tCOLON2 or '.'


Hi Reury,

Line 6 is causing the problem. Replace it with puts alphabetize(numbers), and you'll get passed :)


i dont get how ruby works but it seem to me array r pointers ? so wouldnt passing a vector as argument modify numbers and also couldnt quite understand why mine didnt work


def numbers defines a function in Ruby, so you needed to have your function do something, then end. Since you didn't have it like that, it caused a syntax error.


It gave me an error, but it let me pass :confused:


@falconheavy Please create a new topic, and someone will help you over there :slightly_smiling: