Files
starcells 6475938e6c Add a place to give the machine its input
INP read straight from stdin with scanf, which the live view cannot offer: the
view owns the terminal, and a tape that wants input either ate a number nobody
typed or blocked on a pipe.

INP now takes its value from, in order:

  1. a queue filled by --input "7,5" (spaces or commas, scripts and tests)
  2. a hook the live view installs: it prints 'input> ' under the frame and
     reads a line, redraws on the next tick, and feeds 0 when stdin is done so
     a tape behind a pipe still finishes
  3. stdin, exactly as before

So nothing changes for a plain run, and --live can drive programs that need
input.  tapes/echo.rot8 (just ',.') is the smallest tape that exercises it.

    rot8_test --input 42 tapes/echo.rot8        -> 42
    rot8_test --live tapes/echo.rot8            -> asks under the view

Tests: --input with one value, with a list, a live run fed through a pipe
(prints 5), and a live run with stdin already closed (feeds 0, terminates).
The --dump path and the untouched tapes (and, or, full_adder, wave) still work.
2026-11-06 20:35:30 +08:00

1 line
2 B
Plaintext