Page 1 of 1

Brainfuck Interpreter in ZZT-OOP

Posted: Mon Nov 12, 2007 5:19 am
by duerig
A while back I wrote a Brainfuck interpreter in ZZT as a programming challenge and for nostalgia's sake. It doesn't really use any special ascii-graphics and it isn't really a game, so I wanted to check before submitting it. Is there any interest?

If you don't know, brainfuck is a minimalistic esoteric programming language. It has a very restricted set of operators while being theoretically equivalent to C, Java, and any other language. See http://esoteric.voxelperfect.net/wiki/Brainfuck for more information.

-D

Posted: Mon Nov 12, 2007 6:10 am
by LANCER ECKS
how long can the bf programs fed into your engine be? and how much memory/stack is provided?

Posted: Mon Nov 12, 2007 6:18 am
by duerig
It can accept at most 116 BF instructions in a program. (With a slight tweak, this could be increased to 120).

The memory consists of 54 8-bit cells. (Likewise expandable to 60 with a slight modification).

The main limitation is that the only way that I've found of storing the information is using physical walls on the board, which each wall being a bit. Instructions require three bits and memory eight bits. With two banks of instructions, and one of memory, the entire board is pretty much used up.

-D

Posted: Mon Nov 12, 2007 8:45 am
by duerig
Well, since there was at least one reply, I uploaded it to the archive. When I did, I noticed that I violate the >10kB rule as well. Regardless, until the database is updated and a decision is made as to whether to make an exception in my case, you can find a copy at:

http://www.anotbnotornot.com/brain.zip

The program above also includes a documentation board which describes how the system is implemented for those who are interested. If there are any other questions about it, I will be happy to answer them.

-D

Posted: Mon Nov 12, 2007 12:07 pm
by gingermuffins
wil wrote one too, but you can't find it by searching brainfuck because it's abbreviated

here:

http://zzt.org/zgames/b/BFI.zip

Posted: Mon Nov 12, 2007 7:46 pm
by duerig
Hmm. I'm a bit disappointed that my interpreter isn't as original as I thought it was. It does have a couple of advantages over wil's, such as displaying your program symbolically rather than as just colors. But wil manages to get 3 bits per square rather than 1.

I thought about how to use that extra information, and I realize that by combining my interpreter with wil's 3-bit storage, I can create a mark 2 version that is vastly improved. It could have up to 644 instructions in a program and 174 9-bit memory locations. These numbers could be adjusted by trading 6 memory cells for 23 code instructions.

Posted: Mon Nov 12, 2007 9:52 pm
by Commodore
should I be surprised that there are now two bf interpreters in zzt?

yes

at first I was like WTF wil you already did that.

Posted: Mon Nov 12, 2007 11:07 pm
by Quantum P.
It's hard to be original.

Although you are the first to make a ZZT bf interpreter that uses 8-bit bytes for input/output, as far as I know.