Ruby: Méthodes, blocs et tri


#1

Hello could someone tell me what 's wrong with my code ? it should class those books in inversed alphabetical order

livres = ["Utopia", "Charlie et la chocolaterie","Une brève histoire du temps", "Guerre et Paix", "Un raccourci dans le temps"]

livres.sort! { |premierLivre, secondLivre| premierLivre <=> secondLivre }


#2

What exercise are you on?


#3

hello i'm on : Méthodes, blocs et tri (in french) should translate it by : methos, blocks and sort by


#4

oups i forget : lesson 15


#5

books = ["Charlie and the Chocolate Factory", "War and Peace", "Utopia", "A Brief History of Time", "A Wrinkle in Time"]

To sort our books in ascending order, in-place

books.sort! { |firstBook, secondBook| firstBook <=> secondBook }

Sort your books in descending order, in-place below

books.sort! { |secondBook, firstBook| firstBook <=> secondBook }


#6

thanks a lot i must be too tired not to have think of it


#7

If that was a solution, please click the check mark.