I write something like this in Ruby:
if a.max == a[0]
brand = b[0]
elsif a.max == a[1]
brand = b[1]
elsif a.max == a[2]
brand = b[2]
elsif a.max == a[3]
brand = b[3]
end
Is there any way to check all if and elsif's in the same condition? Only one condition for a[1], a[2], a[3] and a[0] ?
Aucun commentaire:
Enregistrer un commentaire