+ 4

User input in ruby

When I write ruby codes on my computer and execute in my terminal it is possible to have multiple user inputs. It seems like this is not possible here. For example making an easy calculater with the outputs: "Enter first number" then the user input and following "enter operater" and "enter second number".. This problem makes it impossible to write even easy codes in ruby. Will this be fixed anytime soon?

1st Oct 2019, 11:18 AM
Justin Luttkau
Justin Luttkau - avatar
8 Réponses
+ 14
This may be helpful to you for handling inputs in Sololearn : https://code.sololearn.com/WhiNb9BkJUVC/?ref=app
1st Oct 2019, 12:38 PM
Nova
Nova - avatar
+ 6
This is not just Ruby specific but a limitation of SL code playground.
1st Oct 2019, 11:27 AM
Sonic
Sonic - avatar
+ 4
Nova wow what a great code. Thanks for this amazing illustration.
1st Oct 2019, 12:45 PM
Justin Luttkau
Justin Luttkau - avatar
+ 3
Thanks for your answer.
1st Oct 2019, 11:29 AM
Justin Luttkau
Justin Luttkau - avatar
+ 3
the solution for this is to input all data at once on a separate lines
1st Oct 2019, 9:34 PM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 2
✳AsterisK✳ yes but I originally thought if there might be a solution to get the output und following the user input. But thanks of course Bro. I'm more into ruby now, because the company I will start working with on Friday codes in ruby. But I will most likely be 'just' an service technician. Like you know I finally got an IT job as I always wanted. Greetz
1st Oct 2019, 9:46 PM
Justin Luttkau
Justin Luttkau - avatar
+ 2
that's cool bro, but the reason being is just that, all codes are been compiled on the server which will not allow interactive user input, probably for speed and security reasons, most online compilers work the same way too
1st Oct 2019, 9:54 PM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 2
✳AsterisK✳ Yes I know that due to that amazing illustration and other posts. But TY
1st Oct 2019, 9:56 PM
Justin Luttkau
Justin Luttkau - avatar