EOF error | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

EOF error

I have written this game, but the input keeps giving me an EOF error, any way to fix this? https://code.sololearn.com/citfit7vjHlF/?ref=app

23rd Jul 2020, 3:13 PM
Blake Haynes
3 Answers
+ 1
Blake Haynes , in my opinion: in Playground you should enter the whole input at once - it's not interactive. And if you don't guess the number it causes infinite loop. That's why the program never reaches the end. Maybe you should add as a condition number of tries to guess the number.
23rd Jul 2020, 3:26 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
0
End of file while reading code by compiler. Use try and catch .
23rd Jul 2020, 3:28 PM
shubham kumar
shubham kumar - avatar
0
So how would i go about using try and catch in this?
23rd Jul 2020, 4:25 PM
Blake Haynes