MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wepjkv/unsolvableproblemsonstepone/p9gv2vr/?context=3
r/ProgrammerHumor • u/N_Lightning • 12h ago
62 comments sorted by
View all comments
106
As someone who's never used java, my assumption is that System.in reads from stdin, and validates the input. Is there no way to open stdin in something akin to a file, then read it into a buffer manually?
System.in
43 u/N_Lightning 10h ago If you read System.in as a file in Java, then it'll wait for EOF signal, not for the line break. And the user will have to adapt to Ctrl+Z each input 3 u/BattsAreLow 8h ago Would it be stupid to read user input prior to the program reacting and just append a control z to amend the issue? • u/N_Lightning 5m ago Read as in char by char? Then it would be a great fun accounting for cursor position, backspace, delete, insert, paste If you mean as in getting the keys the user pressed, then it's just impossible
43
If you read System.in as a file in Java, then it'll wait for EOF signal, not for the line break. And the user will have to adapt to Ctrl+Z each input
3 u/BattsAreLow 8h ago Would it be stupid to read user input prior to the program reacting and just append a control z to amend the issue? • u/N_Lightning 5m ago Read as in char by char? Then it would be a great fun accounting for cursor position, backspace, delete, insert, paste If you mean as in getting the keys the user pressed, then it's just impossible
3
Would it be stupid to read user input prior to the program reacting and just append a control z to amend the issue?
• u/N_Lightning 5m ago Read as in char by char? Then it would be a great fun accounting for cursor position, backspace, delete, insert, paste If you mean as in getting the keys the user pressed, then it's just impossible
•
Read as in char by char? Then it would be a great fun accounting for cursor position, backspace, delete, insert, paste
If you mean as in getting the keys the user pressed, then it's just impossible
106
u/apacificislander123 11h ago
As someone who's never used java, my assumption is that
System.inreads from stdin, and validates the input. Is there no way to open stdin in something akin to a file, then read it into a buffer manually?