Execute Brain****/Erlang: Difference between revisions
Content added Content deleted
m (moved RCBF/Erlang to Execute Brain****/Erlang) |
(Added reading eof from input as -1 (some implementations use 0)) |
||
Line 37: | Line 37: | ||
run(<< $,, Ins/binary>>, DataPtr, Tape) -> |
run(<< $,, Ins/binary>>, DataPtr, Tape) -> |
||
<<Prev:(DataPtr)/binary, _/integer, Next/binary>> = Tape, |
<<Prev:(DataPtr)/binary, _/integer, Next/binary>> = Tape, |
||
X = case io:get_chars("",1) of |
|||
[C] -> C; |
|||
eof -> -1 |
|||
end, |
|||
run(Ins, DataPtr, <<Prev/binary, X/integer, Next/binary>>); |
run(Ins, DataPtr, <<Prev/binary, X/integer, Next/binary>>); |
||
run(<< $[, Ins/binary>>, DataPtr, Tape) -> |
run(<< $[, Ins/binary>>, DataPtr, Tape) -> |