Execute Brain****/Lua: Difference between revisions
m
Fixed syntax highlighting.
(Fixed bracket matching and made them a bit more robust.) |
m (Fixed syntax highlighting.) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 2:
An implementation of a Brainf*** interpreter in [[Lua]].
<
program = io.read("*all")
pointer = 1
Line 36:
if program:sub(instruction, instruction) == "[" then
b = b + 1
elseif program:sub(instruction, instruction) == "]" then
b = b - 1
end
Line 66:
if instr then instr() end
instruction = instruction + 1
end</
|