+ 2

Ruby playground in the application

Hey guys, I’m new here but seems like ruby playground is not working right. For example i can’t use “gets” more than once in the code there: a = gets.to_i b = gets.to_i c = gets.to_i d = (a+b+c) / 3 puts 'First number:' + a.to_s puts 'Second number:' + b.to_s puts 'Third number:' + c.to_s puts 'Middle number:' + d.to_s PS: everything is working ok in my command panel. PPS: Thank you very much everyone, the problem is solved.

15th May 2019, 9:59 PM
Shiva Dzi
Shiva Dzi - avatar
5 Antworten
+ 2
You need to separate inputs on each line. When you have more than one input, you write them in separate lines. Like this: 2 5 6 The code will work if you write them like this.
15th May 2019, 10:21 PM
inxanedev!
inxanedev! - avatar
+ 4
One of the biggest problems of SoloLearn is that it does not allow dynamic inputs. If you need to enter more than one input, you must put them all together in the alert, separated by line breaks.
15th May 2019, 10:22 PM
InvBoy [ :: FEDE :: ]
InvBoy [ :: FEDE :: ] - avatar
+ 4
InxaneNinja But the fact of not accepting dynamic inputs, it limits you a lot, besides that makes believe to the new that your code does not work... SoloLearn is adding many improvements, I hope it will improve this system at some point.
15th May 2019, 10:28 PM
InvBoy [ :: FEDE :: ]
InvBoy [ :: FEDE :: ] - avatar
+ 2
InvBoy I wouldn't say it's a problem, more like a feature everyone wants yet it's hard to implement. Codes still work fine, indicating it's not a big problem.
15th May 2019, 10:24 PM
inxanedev!
inxanedev! - avatar
+ 2
InvBoy I can safely assume they won't touch anything with how their compilers and inputs work. It's gonna slow everything down a lot, and also they will need more money to keep the servers up.
15th May 2019, 10:34 PM
inxanedev!
inxanedev! - avatar