user1003382 user1003382 - 1 year ago 169
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?

Answer Source

I suggest using JLine

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download