This won’t work on SoloLearn 😢 | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

This won’t work on SoloLearn 😢

Why does this not work on Sololearn but it works in Repl (and in irb)? def check(x) if x == "Grr" return "Lion "   elsif x == "Rawr"    return "Tiger "   elsif x == "Chirp"    return "Bird "   else    return "Snake "   end end animals = gets.chomp.split(" ") for i in 0..(animals.count)-1  print check(animals[i]) end

8th Jul 2020, 9:33 AM
Colin Frame
Colin Frame - avatar
2 Réponses
+ 1
Sololearns codeplayground is not propperly devoleped yet Or sl uses dif version of ruby
8th Jul 2020, 1:00 PM
Gurseerit Singh Chahal ✓
Gurseerit Singh Chahal ✓ - avatar
0
I’ve got it working now...I removed all the indents 👍🏻 def check(x) if x == "Grr" return "Lion " elsif x == "Rawr" return "Tiger " elsif x == "Chirp" return "Bird " else return "Snake " end end animals = gets.chomp.split(" ") for i in 0..(animals.count)-1 print check(animals[i]) end
10th Jul 2020, 9:33 AM
Colin Frame
Colin Frame - avatar