Read one character of input?

L

Leif K-Brooks

I'm trying to write a Brainfuck interpreter in Perl out of boredom and
desire to improve my skills. I'm running into one prroblem, though:
Brainfuck needs to read one character of input at a time, and I'm not
sure how to it. I've considered reading a line of input at a time and
giving it to the Brainfuck program one character at a time, but is there
a better/easier way?
 
J

Jürgen Exner

Leif said:
I'm trying to write a Brainfuck interpreter in Perl out of boredom and
desire to improve my skills. I'm running into one prroblem, though:
Brainfuck needs to read one character of input at a time, and I'm not
sure how to it. I've considered reading a line of input at a time and
giving it to the Brainfuck program one character at a time, but is
there a better/easier way?

RTFM: 'perldoc -q single':
How can I read a single character from a file? From the keyboard?

jue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,263
Messages
2,571,062
Members
48,769
Latest member
Clifft

Latest Threads

Top