Read one character of input?

Discussion in 'Perl' started by Leif K-Brooks, Dec 10, 2003.

  1. 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?
    Leif K-Brooks, Dec 10, 2003
    #1
    1. Advertising

  2. Leif K-Brooks wrote:
    > 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
    Jürgen Exner, Dec 10, 2003
    #2
    1. Advertising

  3. Leif K-Brooks

    Alex Zeng Guest

    getc ?

    "Leif K-Brooks" <> wrote in message
    news:47FBb.597$...
    > 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?
    >
    Alex Zeng, Dec 11, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. penny336
    Replies:
    4
    Views:
    547
    osmium
    Jan 15, 2004
  2. Chris
    Replies:
    4
    Views:
    297
  3. Replies:
    0
    Views:
    238
  4. Melissa
    Replies:
    2
    Views:
    591
    Gaurav Vaish \(a.k.a. MasterGaurav\)
    Dec 26, 2008
  5. Tena
    Replies:
    3
    Views:
    162
    Martijn Lievaart
    Nov 6, 2007
Loading...

Share This Page