Execute Brain****/Erlang: Difference between revisions

Added reading eof from input as -1 (some implementations use 0)
(Added reading eof from input as -1 (some implementations use 0))
Line 37:
run(<< $,, Ins/binary>>, DataPtr, 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/binary>>, DataPtr, Tape) ->
Anonymous user