Ruby code not working

hi everyone ive got a question: so i wrote this def that sorts the words in reverse when i tell it to be true but i’ve gotten no clue where to write the “true” in my puts line

thanks anyways!

ps: sorry if it isnt the right catigory or i cant put it on this form im not sure

Hi, this type of programming question is better suited for a Ruby forum. Cheers.

It’s better to ask these types of questions on StackOverflow (or a similar forum, as Mitchell suggested).

Regardless, you have an error in your if statement. It should be:

unless reverse
  ...
else
  ...
end

FYI, you can call .reverse on an array to achieve the same result.

oh i cant use if?

It will be if !reverse then.