+ 1
How does sololearn's inputting system work? [Solved]
Hi, I am trying to make a simple text game like the ones you can whip up in 5 minutes or less in C, but for some reason, when I try to do it via a Sololearn code bit, it just inputs once and constantly says 'no command found' since the buffer gets emptied out before each read. But I compile it myself and it works perfectly fine, so I removed the while loop that makes it loop like a text game, but I still wonder why that is. Note: The code bit is on my profile, it's like my only bit since I deleted the others.
2 Respuestas
+ 6
Abdulrahman Alyassi Sololearn runs every console-based program as a batch job on their server. Their run script takes all input upfront and stores it into a file. When it runs your program it redirects your program's input stream to come from that file.
Also, it redirects the console output stream from your program into another file. When your batch job is completed, Sololearn's run script displays the contents of the output file to your screen.
For these reasons, Sololearn cannot run console-based programs interactively.
+ 3
when you run it, it asks for all the input at once. for instance:
7
13
(separate each inputs with enters)