Talk:pRINT

From Esolang
Jump to navigation Jump to search

Brainfuck interpreter

Here is a brainfuck interpreter:

>>>>>>>>>>>>>>>,----------[<<<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>[-]<[-]>>[<<+>>-]+<<<[>->+<<-]>>[<<+>>-]<[>>-<<[-]]<[-]>>[-]<[-]>>[<+<+>>-]<[>+<-]<[>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.[-][-]++++++++++.[-]<[-]]>>,----------]

It treats the first line of input as the program, and outputs print and a line feed for every p in the program.

It is compiled from this BFFuck program:

x=inc
sub(x,10)
while(x)
eq(x,102)
if(x)
print(print)
outc(10)
endif
x=inc
sub(x,10)
endwhile

But, honestly, it isn't very optimized. --None1 (talk) 01:04, 16 August 2023 (UTC)

I tried to make another brainfuck interpreter:

+++++++[>>++++[<++++>-]<<-],[>-<-]>[>+<]<+++++[>>+++++[<++++>-]+<<-]>+-----.++.---------.+++++.++++++.

--EvyLah (talk) 21:41, 10 February 2024 (UTC)