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.
Defman
September 25, 2017, 8:42pm
3
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.
Defman
September 26, 2017, 5:05pm
5
It will be if !reverse
then.