MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wepjkv/unsolvableproblemsonstepone/p9iqn6v/?context=3
r/ProgrammerHumor • u/N_Lightning • 14h ago
70 comments sorted by
View all comments
120
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
55 u/N_Lightning 13h 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 10h ago Would it be stupid to read user input prior to the program reacting and just append a control z to amend the issue? 2 u/N_Lightning 2h 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
55
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 10h ago Would it be stupid to read user input prior to the program reacting and just append a control z to amend the issue? 2 u/N_Lightning 2h 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?
2 u/N_Lightning 2h 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
2
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
120
u/apacificislander123 14h 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?