Okay I'm an idiot. 13/19


#1

I can not believe how dumb I am sometimes. I was COMPLETELY overthinking this problem of how to sort the book names in the method (books). It literally says in the description of the problem "...let Ruby sort it out." I was trying so many different ways and attempting all this weird assbackwards code and I was like why isn't this working?!....because all I had to do was at the end, put the (.sort!) keyword. #dumb.

That's all!


#2

Idiot. Been there done that. For example, Method, Blocks, Sorting exercise 9 all I had to do was:
def by_three?(number)
return number % 3 == 0
end
t = by_three?(99)

But here I was trying out if and return true. Isn't that why the method ends in "?" ?
Cheers.
- Another Idiot


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.