I had the following error at the beginning: (ruby):2: warning: found = in conditional, should be ==
So I modified it and it's now working well but I don't get it ... why the boolean is defined with only one = in my method here:
def alphabetique(tableau, inv=false)
And later I've to tell Ruby that if this same boolean is == true, the array has to be reversed ?
Why in this case should we use a double == ?
def alphabetique(tableau, inv=false) tableau.sort! if inv==true tableau.reverse! else return tableau end end nombres = [12,55,200,1] alphabetique(nombres) puts nombres