user1003382 user1003382 - 2 months ago 7x
Brainfuck Question

Advanced Java console input

As a self-practice, I'm making a BF interpreter in Java that does I/O through the console. For the most part it's fine, however, as you might be aware, BF takes input one character at a time, including newlines. This means that as far as I know the standard console input libraries won't work, because they take in entire strings, and then ask for a return at the end. I want

to take in the next keystroke that fits into a
without printing it when it is typed. So when BF asks for input, and you type in
, it takes in the
but doesn't show it in the console unless the BF program outputs
itself later.

How can I do this?


I suggest using JLine

The Terminal class has a disableEcho() method to do what you want.