Quotes help make search much faster. Example: "Practice Makes Perfect"

Wednesday, November 21, 2012

Codecademy: "Victory! (Almost)"


#sample solution


def alphabetize(arr, rev=false)
  if rev
    arr.sort!.reverse!
  else
    arr.sort!
  end
end

puts alphabetize(["b","a","d","c"])
puts #space
puts alphabetize(["b","a","d","c"],true)

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts